Tests require Test::More-0.88 or up (RT#70538)
[Data-Peek.git] / Makefile.PL
blobb08bdb8ab9fcabc0928f972f8332a828fd1c3ad3
1 #!/usr/bin/perl
3 # Copyright PROCURA B.V. (c) 2008-2011 H.Merijn Brand
5 require 5.008; # <- also see postamble at the bottom for META.yml
6 use strict;
8 use ExtUtils::MakeMaker;
10 my %wm = (
11 NAME => "Data::Peek",
12 ABSTRACT => "Extended/Modified debugging utilities",
13 AUTHOR => "H.Merijn Brand <h.merijn\@xs4all.nl>",
14 VERSION_FROM => "Peek.pm",
15 PREREQ_PM => { "DynaLoader" => 0,
16 "Data::Dumper" => 0,
17 "Test::More" => 0.88,
18 "Test::Harness" => 0,
19 "Test::NoWarnings" => 0,
21 clean => { FILES => join " ", qw(
22 Peek.c.gcov
23 Peek.gcda
24 Peek.gcno
25 Peek.xs.gcov
26 cover_db
27 valgrind.log
31 $ExtUtils::MakeMaker::VERSION > 6.30 and $wm{LICENSE} = "perl";
33 unless (exists $ENV{AUTOMATED_TESTING} and $ENV{AUTOMATED_TESTING} == 1) {
34 if (prompt ("Do you want to install module DP as a shortcut for Data::Peek ?", "y") =~ m/[yY]/) {
35 local $/;
36 open my $pm, "<", "Peek.pm" or die "CAnnot read Peek.pm: $!\n";
37 my $vsn = do { <$pm> =~ m/^\$VERSION\s*=\s*"([0-9._]+)/m; $1 };
38 close $pm;
40 (my $dp = <DATA>) =~ s/::VERSION::/"$vsn"/;
41 open my $fh, ">", "DP.pm" or die "Cannot open DP.pm: $!\n";
42 print $fh $dp;
43 close $fh;
44 $wm{PM} = {
45 "Peek.pm" => '$(INST_LIB)/Data/Peek.pm',
46 "DP.pm" => '$(INST_LIB)/DP.pm',
48 $wm{clean}{FILES} .= " DP.pm";
52 $ENV{NO_SV_PEEK} and $wm{DEFINE} = "-DNO_SV_PEEK";
54 my $rv = WriteMakefile (%wm);
58 package MY;
60 sub postamble
62 my $valgrind = join " ", qw(
63 PERL_DESTRUCT_LEVEL=2 PERL_DL_NONLAZY=1
64 valgrind
65 --suppressions=sandbox/perl.supp
66 --leak-check=yes
67 --leak-resolution=high
68 --show-reachable=yes
69 --num-callers=50
70 --log-fd=3
71 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e"
72 "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"
73 $(TEST_FILES) 3>valgrind.log
76 my $min_vsn = ($] >= 5.010 && -d "xt" && ($ENV{AUTOMATED_TESTING} || 0) != 1)
77 ? join "\n" =>
78 'test ::',
79 ' -@env TEST_FILES="xt/*.t" make -e test_dynamic',
81 : "";
82 join "\n" =>
83 'cover test_cover:',
84 ' ccache -C',
85 ' cover -test',
86 '',
87 'leakcheck:',
88 " $valgrind",
89 ' -@tail -5 valgrind.log',
90 '',
91 'leaktest:',
92 q{ sandbox/leaktest $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
93 '',
94 'spellcheck:',
95 ' pod-spell-check --aspell --ispell',
96 '',
97 'checkmeta: spellcheck',
98 ' perl sandbox/genMETA.pl -c',
99 '',
100 'fixmeta: distmeta',
101 ' perl sandbox/genMETA.pl',
103 'tgzdist: checkmeta fixmeta $(DISTVNAME).tar.gz distcheck',
104 ' -@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz',
105 ' -@cpants_lint.pl $(DISTVNAME).tgz',
106 ' -@rm -f Debian_CPANTS.txt',
108 $min_vsn;
109 } # postamble
111 __END__
112 use Data::Peek;
114 BEGIN { *DP:: = \%Data::Peek:: }
115 $VERSION = ::VERSION::;
119 =head1 NAME
121 DP - Alias for Data::Peek
123 =head1 SYNOPSIS
125 perl -MDP -wle'print DPeek for DDual ($?, 1)'
127 =head1 DESCRIPTION
129 See L<Data::Peek>.
131 =head1 AUTHOR
133 H.Merijn Brand <h.m.brand@xs4all.nl>
135 =head1 COPYRIGHT AND LICENSE
137 Copyright (C) 2008-2011 H.Merijn Brand
139 This library is free software; you can redistribute it and/or modify it
140 under the same terms as Perl itself.
142 =cut