summaryrefslogtreecommitdiff
path: root/lib/Test/Harness
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-08-15 04:58:34 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-15 04:58:34 +0000
commitcf2ab31a162e9f8507b05df9dcd0911de1e1ef9b (patch)
tree28b786cd0581f7b9a38b2e1e7eb114a020646739 /lib/Test/Harness
parentf43acd3efdbc773df800773c5f46d8357b87de0d (diff)
downloadperl-cf2ab31a162e9f8507b05df9dcd0911de1e1ef9b.tar.gz
Upgrade to Test::Harness 2.30.
p4raw-id: //depot/perl@20716
Diffstat (limited to 'lib/Test/Harness')
-rw-r--r--lib/Test/Harness/Changes32
-rw-r--r--lib/Test/Harness/Straps.pm128
-rw-r--r--lib/Test/Harness/t/pod.t5
3 files changed, 81 insertions, 84 deletions
diff --git a/lib/Test/Harness/Changes b/lib/Test/Harness/Changes
index 37e9e1f180..ea124e2c51 100644
--- a/lib/Test/Harness/Changes
+++ b/lib/Test/Harness/Changes
@@ -1,5 +1,37 @@
Revision history for Perl extension Test::Harness
+2.30 Thu Aug 14 20:04:00 CDT 2003
+ No functional changes in this version. It's only to make some doc
+ tweaks, and bump up the version number in T:H:Straps.
+
+ [DOCUMENTATION]
+ - Changed Schwern to Andy as the maintainer.
+ - Incorporated the TODO file into Harness.pm proper.
+ - Cleaned up formatting in Test::Harness::Straps.
+
+2.29 Wed Jul 17 14:08:00 CDT 2003
+ - Released as 2.29.
+
+2.28_91 Sun Jul 13 00:10:00 CDT 2003
+ [ENHANCEMENTS]
+ - Added support for HARNESS_OK_SLOW. This will make a significant
+ speedup for slower connections.
+ - Folded in some changes from bleadperl that spiff up the
+ failure reports.
+
+ [INTERNALS]
+ - Added some isa_ok() checks to the tests.
+ - All Test::Harness* modules are used by use_ok()
+ - Fixed the prototype for the canonfailed() function, not that
+ it matters since it's never called without parens.
+
+2.28_90 Sat Jul 05 20:21:00 CDT 2003
+ [ENHANCEMENTS]
+ - Now, when you run a test harnessed, the numbers don't fly by one
+ at a time, one update per second. This significantly speeds
+ up the run time for running thousands of tests. *COUGH*
+ Regexp::Common *COUGH*
+
2.28 Thu Apr 24 14:39:00 CDT 2003
- No functional changes.
diff --git a/lib/Test/Harness/Straps.pm b/lib/Test/Harness/Straps.pm
index 294dafa8f0..94fd363490 100644
--- a/lib/Test/Harness/Straps.pm
+++ b/lib/Test/Harness/Straps.pm
@@ -1,12 +1,12 @@
# -*- Mode: cperl; cperl-indent-level: 4 -*-
-# $Id: Straps.pm,v 1.17 2003/04/03 17:47:25 andy Exp $
+# $Id: Straps.pm,v 1.18 2003/08/15 01:29:23 andy Exp $
package Test::Harness::Straps;
use strict;
use vars qw($VERSION);
use Config;
-$VERSION = '0.141';
+$VERSION = '0.15';
use Test::Harness::Assert;
use Test::Harness::Iterator;
@@ -58,11 +58,9 @@ The interface is currently incomplete. I<Please> contact the author
if you'd like a feature added or something change or just have
comments.
-=head2 Construction
+=head1 Construction
-=over 4
-
-=item B<new>
+=head2 C<new>
my $strap = Test::Harness::Straps->new;
@@ -80,9 +78,7 @@ sub new {
return $self;
}
-=begin _private
-
-=item B<_init>
+=head2 C<_init>
$strap->_init;
@@ -97,23 +93,18 @@ sub _init {
$self->{_is_win32} = $^O eq 'Win32';
}
-=end _private
-
-=back
-
-=head2 Analysis
-
-=over 4
+=head1 Analysis
-=item B<analyze>
+=head2 C<analyze>
my %results = $strap->analyze($name, \@test_output);
-Analyzes the output of a single test, assigning it the given $name for
-use in the total report. Returns the %results of the test. See
-L<Results>.
+Analyzes the output of a single test, assigning it the given C<$name>
+for use in the total report. Returns the C<%results> of the test.
+See L<Results>.
-@test_output should be the raw output from the test, including newlines.
+C<@test_output> should be the raw output from the test, including
+newlines.
=cut
@@ -231,7 +222,7 @@ sub _analyze_line {
$self->{'next'} = $result{number} + 1 if $type eq 'test';
}
-=item B<analyze_fh>
+=head2 C<analyze_fh>
my %results = $strap->analyze_fh($name, $test_filehandle);
@@ -246,11 +237,11 @@ sub analyze_fh {
$self->_analyze_iterator($name, $it);
}
-=item B<analyze_file>
+=head2 C<analyze_file>
my %results = $strap->analyze_file($test_file);
-Like C<analyze>, but it runs the given $test_file and parses it's
+Like C<analyze>, but it runs the given C<$test_file> and parses its
results. It will also use that name for the total report.
=cut
@@ -308,9 +299,7 @@ else {
}
-=begin _private
-
-=item B<_switches>
+=head2 C<_switches>
my $switches = $self->_switches($file);
@@ -344,12 +333,12 @@ sub _switches {
}
-=item B<_INC2PERL5LIB>
+=head2 C<_INC2PERL5LIB>
local $ENV{PERL5LIB} = $self->_INC2PERL5LIB;
-Takes the current value of @INC and turns it into something suitable
-for putting onto PERL5LIB.
+Takes the current value of C<@INC> and turns it into something suitable
+for putting onto C<PERL5LIB>.
=cut
@@ -361,12 +350,12 @@ sub _INC2PERL5LIB {
return join $Config{path_sep}, $self->_filtered_INC;
}
-=item B<_filtered_INC>
+=head2 C<_filtered_INC>
my @filtered_inc = $self->_filtered_INC;
-Shortens @INC by removing redundant and unnecessary entries.
-Necessary for OS's with limited command line lengths, like VMS.
+Shortens C<@INC> by removing redundant and unnecessary entries.
+Necessary for OSes with limited command line lengths, like VMS.
=cut
@@ -385,11 +374,11 @@ sub _filtered_INC {
}
-=item B<_restore_PERL5LIB>
+=head2 C<_restore_PERL5LIB>
$self->_restore_PERL5LIB;
-This restores the original value of the PERL5LIB environment variable.
+This restores the original value of the C<PERL5LIB> environment variable.
Necessary on VMS, otherwise a no-op.
=cut
@@ -404,26 +393,16 @@ sub _restore_PERL5LIB {
}
}
-
-=end _private
-
-=back
-
-
-=begin _private
-
-=head2 Parsing
+=head1 Parsing
Methods for identifying what sort of line you're looking at.
-=over 4
-
-=item B<_is_comment>
+=head2 C<_is_comment>
my $is_comment = $strap->_is_comment($line, \$comment);
Checks if the given line is a comment. If so, it will place it into
-$comment (sans #).
+C<$comment> (sans #).
=cut
@@ -439,14 +418,14 @@ sub _is_comment {
}
}
-=item B<_is_header>
+=head2 C<_is_header>
my $is_header = $strap->_is_header($line);
-Checks if the given line is a header (1..M) line. If so, it places
-how many tests there will be in $strap->{max}, a list of which tests
-are todo in $strap->{todo} and if the whole test was skipped
-$strap->{skip_all} contains the reason.
+Checks if the given line is a header (1..M) line. If so, it places how
+many tests there will be in C<< $strap->{max} >>, a list of which tests
+are todo in C<< $strap->{todo} >> and if the whole test was skipped
+C<< $strap->{skip_all} >> contains the reason.
=cut
@@ -483,12 +462,12 @@ sub _is_header {
}
}
-=item B<_is_test>
+=head2 C<_is_test>
my $is_test = $strap->_is_test($line, \%test);
Checks if the $line is a test report (ie. 'ok/not ok'). Reports the
-result back in %test which will contain:
+result back in C<%test> which will contain:
ok did it succeed? This is the literal 'ok' or 'not ok'.
name name of the test (if any)
@@ -498,7 +477,7 @@ result back in %test which will contain:
reason why is it todo or skip? (if any)
If will also catch lone 'not' lines, note it saw them
-$strap->{saw_lone_not} and the line in $strap->{lone_not_line}.
+C<< $strap->{saw_lone_not} >> and the line in C<< $strap->{lone_not_line} >>.
=cut
@@ -552,7 +531,7 @@ sub _is_test {
}
}
-=item B<_is_bail_out>
+=head2 C<_is_bail_out>
my $is_bail_out = $strap->_is_bail_out($line, \$reason);
@@ -573,12 +552,12 @@ sub _is_bail_out {
}
}
-=item B<_reset_file_state>
+=head2 C<_reset_file_state>
$strap->_reset_file_state;
-Resets things like $strap->{max}, $strap->{skip_all}, etc... so its
-ready to parse the next file.
+Resets things like C<< $strap->{max} >> , C<< $strap->{skip_all} >>,
+etc. so it's ready to parse the next file.
=cut
@@ -595,14 +574,10 @@ sub _reset_file_state {
$self->{'next'} = 1;
}
-=back
-
-=end _private
-
-
-=head2 Results
+=head1 Results
-The %results returned from analyze() contain the following information:
+The C<%results> returned from C<analyze()> contain the following
+information:
passing true if the whole test is considered a pass
(or skipped), false if its a failure
@@ -643,17 +618,13 @@ There is one final item, the details.
Element 0 of the details is test #1. I tried it with element 1 being
#1 and 0 being empty, this is less awkward.
-=begin _private
-
-=over 4
-
-=item B<_detailize>
+=head2 C<_detailize>
my %details = $strap->_detailize($pass, \%test);
-Generates the details based on the last test line seen. $pass is true
-if it was considered to be a passed test. %test is the results of the
-test you're summarizing.
+Generates the details based on the last test line seen. C<$pass> is
+true if it was considered to be a passed test. C<%test> is the results
+of the test you're summarizing.
=cut
@@ -677,17 +648,14 @@ sub _detailize {
return %details;
}
-=back
-
-=end _private
-
=head1 EXAMPLES
See F<examples/mini_harness.plx> for an example of use.
=head1 AUTHOR
-Michael G Schwern E<lt>schwern@pobox.comE<gt>
+Michael G Schwern C<< <schwern@pobox.com> >>, currently maintained by
+Andy Lester C<< <andy@petdance.com> >>.
=head1 SEE ALSO
diff --git a/lib/Test/Harness/t/pod.t b/lib/Test/Harness/t/pod.t
index ef38c05a45..6a299a6273 100644
--- a/lib/Test/Harness/t/pod.t
+++ b/lib/Test/Harness/t/pod.t
@@ -15,12 +15,9 @@ eval "use Test::Pod 0.95";
if ($@) {
plan skip_all => "Test::Pod v0.95 required for testing POD";
} else {
- Test::Pod->import;
my @files;
my $blib = File::Spec->catfile(qw(blib lib));
find( sub {push @files, $File::Find::name if /\.p(l|m|od)$/}, $blib);
plan tests => scalar @files;
- foreach my $file (@files) {
- pod_file_ok($file);
- }
+ Test::Pod::pod_file_ok($_) foreach @files;
}