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;
395 'shbang_misparse' => {
413 plan tests => (keys(%samples) * 7) + 1;
416 use_ok('Test::Harness');
419 tie *NULL, 'My::Dev::Null' or die $!;
421 while (my($test, $expect) = each %samples) {
422 # _run_all_tests() runs the tests but skips the formatting.
423 my($totals, $failed);
426 select NULL; # _run_all_tests() isn't as quiet as it should be.
427 local $SIG{__WARN__} = sub { $warning .= join '', @_; };
429 Test::Harness::_run_all_tests("$SAMPLE_TESTS/$test");
434 skip "special tests for bailout", 1 unless $test eq 'bailout';
435 like( $@, '/Further testing stopped: GERONI/i' );
439 skip "don't apply to a bailout", 5 if $test eq 'bailout';
441 is( Test::Harness::_all_ok($totals), $expect->{all_ok},
443 ok( defined $expect->{total}, "$test - has total" );
444 is_deeply( {map { $_=>$totals->{$_} } keys %{$expect->{total}}},
447 is_deeply( {map { $_=>$failed->{"$SAMPLE_TESTS/$test"}{$_} }
448 keys %{$expect->{failed}}},
454 skip "special tests for bignum", 1 unless $test eq 'bignum';
455 is( $warning, <<WARN );
456 Enourmous test number seen [test 100001]
457 Can't detailize, too big.
458 Enourmous test number seen [test 136211425]
459 Can't detailize, too big.