Debian lenny version packages
[pkg-perl] / deb-src / libtest-harness-perl / libtest-harness-perl-3.12 / t / compat / inc_taint.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if ( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = ( '../lib', 'lib' );
7     }
8     else {
9         use lib 't/lib';
10     }
11 }
12
13 use strict;
14
15 use Test::More tests => 1;
16
17 use Dev::Null;
18
19 use Test::Harness;
20
21 sub _all_ok {
22     my ($tot) = shift;
23     return $tot->{bad} == 0
24       && ( $tot->{max} || $tot->{skipped} ) ? 1 : 0;
25 }
26
27 {
28     local $ENV{PERL_TEST_HARNESS_DUMP_TAP} = 0;
29     local $Test::Harness::Verbose = -9;
30
31     push @INC, 'examples';
32
33     tie *NULL, 'Dev::Null' or die $!;
34     select NULL;
35     my ( $tot, $failed ) = Test::Harness::execute_tests(
36         tests => [
37             $ENV{PERL_CORE}
38             ? 'lib/sample-tests/inc_taint'
39             : 't/sample-tests/inc_taint'
40         ]
41     );
42     select STDOUT;
43
44     ok( _all_ok($tot), 'tests with taint on preserve @INC' );
45 }