File: Makefile.PL

package info (click to toggle)
libtest-simple-perl 0.62-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 540 kB
  • ctags: 137
  • sloc: perl: 3,674; makefile: 43
file content (108 lines) | stat: -rw-r--r-- 2,690 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# A template for Makefile.PL used by Arena Networks.
# - Set the $PACKAGE variable to the name of your module.
# - Set $LAST_API_CHANGE to reflect the last version you changed the API 
#   of your module.
# - Fill in your dependencies in PREREQ_PM
# Alternatively, you can say the hell with this and use h2xs.

use 5.004;

use Config;
use ExtUtils::MakeMaker;

$PACKAGE = 'Test::Simple';
($PACKAGE_FILE = $PACKAGE) =~ s|::|/|g;
$LAST_API_CHANGE    = 0.48;
$LAST_THREAD_CHANGE = 0.48;

eval "require $PACKAGE";

unless ($@) { # Make sure we did find the module.
    if( ${$PACKAGE.'::VERSION'} < $LAST_API_CHANGE ) {
        printf <<"CHANGE_WARN", $LAST_API_CHANGE;

NOTE: There have been API changes between this version and any older
than version %s!  Please see the Changes file for details.

CHANGE_WARN

        sleep 5;
    }
    if( $] >= 5.008 && $Config{useithreads} &&
        ${$PACKAGE.'::VERSION'} < $LAST_THREAD_CHANGE 
      ) 
    {
        printf <<"THREAD_WARN", $LAST_THREAD_CHANGE;

NOTE: The behavior of Test::More and threads has changed between this
version and any older than version %s!  Please see the Changes file
for details.

THREAD_WARN

        sleep 5;
    }

}

WriteMakefile(
    NAME            => $PACKAGE,
    VERSION_FROM    => "lib/$PACKAGE_FILE.pm", # finds $VERSION
    LICENSE         => 'perl',
    PREREQ_PM       => { 
                        Test::Harness   => 2.03,
                       },
    # Added to the core somewhere around 5.7.2.
    INSTALLDIRS     => $] >= 5.00702 ? 'perl' : 'site'
);


{
    package MY;

    use File::Basename;
    sub test_via_harness {
        my($self, $orig_perl, $tests) = @_;

        my @perls = ();
        if( $ENV{PERL_TEST_ALL} ) {
            require File::Spec;
            my $tlib = File::Spec->rel2abs('t/lib/');
            push @perls, 
              map "PERL5LIB=$tlib $_",
                qw(
                   perl5.4.0
                   perl5.4.5
                   perl5.5.3
                   perl5.6.0
                   perl5.6.1
                  );

            push @perls,
              qw(
                 perl
                 perl5.8.0
                 perl5.8.0-ithreads
                 bleadperl
                );
        }
        else {
            push @perls, $orig_perl;
        }

        my $out;
        foreach my $perl (@perls) {
            $out .= $self->SUPER::test_via_harness($perl, $tests) . "\n";
        }
        $out =~ s{-I\$\(PERL_\w*LIB\)}{}g;

        return $out;
    }
}


# Older versions of Test::Simple were very naughty about being required and
# exitted with 255.  This overrides that behavior so it builds from CPAN.
END {
    exit(0);
}