Tests for DDsort
[Data-Peek.git] / Makefile.PL
blob6e379e0337a9af908250ae063a7332db97212469
1 #!/usr/bin/perl
3 # Copyright PROCURA B.V. (c) 2008-2009 H.Merijn Brand
5 require 5.006; # <- 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,
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 'checkmeta:',
95 ' perl sandbox/genMETA.pl -c',
96 '',
97 'fixmeta: distmeta',
98 ' perl sandbox/genMETA.pl',
99 '',
100 'tgzdist: checkmeta fixmeta $(DISTVNAME).tar.gz distcheck',
101 ' -@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz',
102 ' -@cpants_lint.pl $(DISTVNAME).tgz',
103 ' -@rm -f Debian_CPANTS.txt',
105 $min_vsn;
106 } # postamble
108 __END__
109 use Data::Peek;
111 BEGIN { *DP:: = \%Data::Peek:: }
112 $VERSION = ::VERSION::;
116 =head1 NAME
118 DP - Alias for Data::Peek
120 =head1 SYNOPSIS
122 perl -MDP -wle'print DPeek for DDual ($?, 1)'
124 =head1 DESCRIPTION
126 See L<Data::Peek>.
128 =head1 AUTHOR
130 H.Merijn Brand <h.m.brand@xs4all.nl>
132 =head1 COPYRIGHT AND LICENSE
134 Copyright (C) 2008-2009 H.Merijn Brand
136 This library is free software; you can redistribute it and/or modify it
137 under the same terms as Perl itself.
139 =cut