# -*- Mode: cperl; cperl-indent-level: 4 -*-
-# $Id: Harness.pm,v 1.29 2002/05/17 23:04:11 schwern Exp $
+# $Id: Harness.pm,v 1.38 2002/06/19 21:01:01 schwern Exp $
package Test::Harness;
use strict;
use vars qw($VERSION $Verbose $Switches $Have_Devel_Corestack $Curtest
- $Columns $verbose $switches $ML
+ $Columns $verbose $switches $ML $Strap
@ISA @EXPORT @EXPORT_OK
);
$Have_Devel_Corestack = 0;
-$VERSION = '2.22';
+$VERSION = '2.26';
$ENV{HARNESS_ACTIVE} = 1;
my $Files_In_Dir = $ENV{HARNESS_FILELEAK_IN_DIR};
-my $Strap = Test::Harness::Straps->new;
+$Strap = Test::Harness::Straps->new;
@ISA = ('Exporter');
@EXPORT = qw(&runtests);
out each individual test which failed along with a summary report and
a how long it all took.
-It returns true if everything was ok, false otherwise.
+It returns true if everything was ok. Otherwise it will die() with
+one of the messages in the DIAGNOSTICS section.
=for _private
This is just _run_all_tests() plus _show_results()
$tot{files}++;
$Strap->{_seen_header} = 0;
- my %results = $Strap->analyze_file($tfile);
+ my %results = $Strap->analyze_file($tfile) or
+ do { warn "$Strap->{error}\n"; next };
# state of the current test.
my @failed = grep { !$results{details}[$_-1]{ok} }
bonus => $results{bonus},
skipped => $results{skip},
skip_reason => $Strap->{_skip_reason},
+ skip_all => $Strap->{skip_all},
ml => $ml,
);
print "$test{ml}ok\n ".join(', ', @msg)."\n";
} elsif ($test{max}) {
print "$test{ml}ok\n";
- } elsif (defined $test{skip_reason}) {
- print "skipped\n all skipped: $test{skip_reason}\n";
+ } elsif (defined $test{skip_all} and length $test{skip_all}) {
+ print "skipped\n all skipped: $test{skip_all}\n";
$tot{skipped}++;
} else {
- print "\n skipped test on this platform\n";
+ print "skipped\n all skipped: no reason given\n";
$tot{skipped}++;
}
$tot{good}++;