lib/Test/Harness/t/assert.t Test::Harness::Assert test
lib/Test/Harness/t/base.t Test::Harness test
lib/Test/Harness/t/callback.t Test::Harness test
+lib/Test/Harness/t/failure.t Test::Harness test
lib/Test/Harness/t/from_line.t Test::Harness test
lib/Test/Harness/t/harness.t Test::Harness test
lib/Test/Harness/t/inc_taint.t Test::Harness test
=head1 VERSION
-Version 2.60
+Version 2.62
=cut
-$VERSION = '2.60';
+$VERSION = '2.62';
# Backwards compatibility for exportable variable names.
*verbose = *Verbose;
assert(($ok xor keys %$failedtests),
q{ok status jives with $failedtests});
+ if (! $ok) {
+ die("Failed $tot->{bad}/$tot->{tests} test programs. " .
+ "@{[$tot->{max} - $tot->{ok}]}/$tot->{max} subtests failed.\n");
+ }
+
return $ok;
}
Revision history for Perl extension Test::Harness
+2.62 Thu Jun 8 14:11:57 CDT 2006
+ [FIXES]
+ * Restored the behavior of dying if any subtests failed. This is a
+ pretty crucial bug that I should have fixed long ago. Not having this
+ means that CPANPLUS will install modules even if their tests fail. :-(
+
2.60 Wed May 24 14:48:44 CDT 2006
[FIXES]
* Fixed the headers in the summary failure table.
--- /dev/null
+#!/usr/bin/perl -w
+
+BEGIN {
+ if ( $ENV{PERL_CORE} ) {
+ chdir 't';
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+
+use strict;
+
+use Test::More tests => 6;
+
+BEGIN {
+ use_ok( 'Test::Harness' );
+}
+
+my $died;
+sub prepare_for_death { $died = 0; }
+sub signal_death { $died = 1; }
+
+PASSING: {
+ local $SIG{__DIE__} = \&signal_death;
+ prepare_for_death();
+ eval { runtests( "t/sample-tests/simple" ) };
+ ok( !$@, "simple lives" );
+ is( $died, 0, "Death never happened" );
+}
+
+FAILING: {
+ local $SIG{__DIE__} = \&signal_death;
+ prepare_for_death();
+ eval { runtests( "t/sample-tests/too_many" ) };
+ ok( $@, "$@" );
+ ok( $@ =~ m[Failed 1/1], "too_many dies" );
+ is( $died, 1, "Death happened" );
+}