4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib');
13 my $SAMPLE_TESTS = $ENV{PERL_CORE} ? "lib/sample-tests" : "t/sample-tests";
17 # For shutting up Test::Harness.
18 # Has to work on 5.004 which doesn't have Tie::StdHandle.
19 package My::Dev::Null;
26 my $fh = do { local *HANDLE; \*HANDLE };
27 return bless $fh, $class;
38 my $IsVMS = $^O eq 'VMS';
40 # VMS uses native, not POSIX, exit codes.
41 my $die_estat = $IsVMS ? 44 : 1;
42 my $die_wstat = $IsVMS ? 1024 : 256;
367 'shbang_misparse' => {
385 plan tests => (keys(%samples) * 7) + 1;
388 use_ok('Test::Harness');
391 tie *NULL, 'My::Dev::Null' or die $!;
393 while (my($test, $expect) = each %samples) {
394 # _run_all_tests() runs the tests but skips the formatting.
395 my($totals, $failed);
398 select NULL; # _run_all_tests() isn't as quiet as it should be.
399 local $SIG{__WARN__} = sub { $warning .= join '', @_; };
401 Test::Harness::_run_all_tests("$SAMPLE_TESTS/$test");
406 skip "special tests for bailout", 1 unless $test eq 'bailout';
407 like( $@, '/Further testing stopped: GERONI/i' );
411 skip "don't apply to a bailout", 5 if $test eq 'bailout';
413 is( Test::Harness::_all_ok($totals), $expect->{all_ok},
415 ok( defined $expect->{total}, "$test - has total" );
416 is_deeply( {map { $_=>$totals->{$_} } keys %{$expect->{total}}},
419 is_deeply( {map { $_=>$failed->{"$SAMPLE_TESTS/$test"}{$_} }
420 keys %{$expect->{failed}}},
426 skip "special tests for bignum", 1 unless $test eq 'bignum';
427 is( $warning, <<WARN );
428 Enourmous test number seen [test 100001]
429 Can't detailize, too big.
430 Enourmous test number seen [test 136211425]
431 Can't detailize, too big.