@@ -12,52 +12,50 @@ use File::Spec;
12
12
use vars qw( $VERSION ) ;
13
13
$VERSION = ' 2.64' ;
14
14
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;
20
20
my @includes = ();
21
21
my @switches = ();
22
22
23
23
# Allow cuddling the paths with the -I
24
- @ARGV = map { / ^(-I)(.+)/ ? ( $1 , $2 ) : $_ } @ARGV ;
24
+ @ARGV = map { / ^(-I)(.+)/ ? ($1 ,$2 ) : $_ } @ARGV ;
25
25
26
26
# Stick any default switches at the beginning, so they can be overridden
27
27
# 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 };
30
29
31
- Getopt::Long::Configure(' no_ignore_case' );
32
- Getopt::Long::Configure(' bundling' );
30
+ Getopt::Long::Configure( ' no_ignore_case' );
31
+ Getopt::Long::Configure( ' bundling' );
33
32
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;
54
52
55
53
$ENV {TEST_VERBOSE } = 1 if $Test::Harness::verbose ;
56
54
57
55
# Handle blib includes
58
- if ($blib ) {
56
+ if ( $blib ) {
59
57
my @blibdirs = blibdirs();
60
- if (@blibdirs ) {
58
+ if ( @blibdirs ) {
61
59
unshift @includes , @blibdirs ;
62
60
}
63
61
else {
@@ -66,16 +64,14 @@ if ($blib) {
66
64
}
67
65
68
66
# Handle lib includes
69
- if ($lib ) {
67
+ if ( $lib ) {
70
68
unshift @includes , ' lib' ;
71
69
}
72
70
73
71
# Build up TH switches
74
- push ( @switches ,
75
- map { / \s / && !/^" .*" $/ ? qq[ "-I$_ "] : " -I$_ " } @includes );
72
+ push ( @switches , map { / \s / && !/^" .*" $/ ? qq[ "-I$_ "] : " -I$_ " } @includes );
76
73
$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 ;
79
75
80
76
@ARGV = File::Spec-> curdir unless @ARGV ;
81
77
my @argv_globbed ;
@@ -85,31 +81,27 @@ if ( $] >= 5.006001 ) {
85
81
@argv_globbed = map { File::Glob::bsd_glob($_ ) } @ARGV ;
86
82
}
87
83
else {
88
- @argv_globbed = map {glob } @ARGV ;
84
+ @argv_globbed = map { glob } @ARGV ;
89
85
}
90
86
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 => $_ } ) : $_ )
94
89
}
95
90
96
- if (@tests ) {
91
+ if ( @tests ) {
97
92
shuffle(@tests ) if $shuffle ;
98
- if ($dry ) {
93
+ if ( $dry ) {
99
94
print join ( " \n " , @tests , ' ' );
100
95
}
101
96
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 ;
104
98
runtests(@tests );
105
99
}
106
100
}
107
101
108
102
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 );
113
105
}
114
106
115
107
__END__
0 commit comments