diff options
Diffstat (limited to 'lib/Test/Harness/t/test-harness.t')
-rw-r--r-- | lib/Test/Harness/t/test-harness.t | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/Test/Harness/t/test-harness.t b/lib/Test/Harness/t/test-harness.t index 7a4e6b8e52..dbdc6f9169 100644 --- a/lib/Test/Harness/t/test-harness.t +++ b/lib/Test/Harness/t/test-harness.t @@ -487,7 +487,8 @@ my %samples = ( }, ); -plan tests => (keys(%samples) * 7); +my $tests_per_loop = 8; +plan tests => (keys(%samples) * $tests_per_loop); use Test::Harness; my @_INC = map { qq{"-I$_"} } @INC; @@ -497,23 +498,21 @@ tie *NULL, 'Dev::Null' or die $!; for my $test ( sort keys %samples ) { SKIP: { - skip "-t introduced in 5.8.0", 7 if $test eq 'taint_warn' and $] < 5.008; + skip "-t introduced in 5.8.0", $tests_per_loop + if ($test eq 'taint_warn') && ($] < 5.008); my $expect = $samples{$test}; - # _run_all_tests() runs the tests but skips the formatting. + # execute_tests() runs the tests but skips the formatting. my($totals, $failed); my $warning = ''; my $test_path = File::Spec->catfile($SAMPLE_TESTS, $test); print STDERR "# $test\n" if $ENV{TEST_VERBOSE}; eval { - select NULL; # _run_all_tests() isn't as quiet as it should be. local $SIG{__WARN__} = sub { $warning .= join '', @_; }; - ($totals, $failed) = - Test::Harness::_run_all_tests($test_path); + ($totals, $failed) = Test::Harness::execute_tests(tests => [$test_path], out => \*NULL); }; - select STDOUT; # $? is unreliable in MacPerl, so we'll just fudge it. $failed->{estat} = $die_estat if $IsMacPerl and $failed; @@ -524,7 +523,7 @@ SKIP: { } SKIP: { - skip "don't apply to a bailout", 5 if $test eq 'bailout'; + skip "don't apply to a bailout", 6 if $test eq 'bailout'; is( $@, '' ); is( Test::Harness::_all_ok($totals), $expect->{all_ok}, "$test - all ok" ); @@ -536,6 +535,11 @@ SKIP: { keys %{$expect->{failed}}}, $expect->{failed}, "$test - failed" ); + + skip "No tests were run", 1 unless $totals->{max}; + + my $output = Test::Harness::get_results($totals, $failed); + like( $output, '/All tests successful|List of Failed/' ); } my $expected_warnings = ""; |