3 use ExtUtils::MakeMaker;
7 print 'Checking for valgrind >= 3.1.0 in PATH... ';
8 for (split /:/, $ENV{PATH}) {
9 $vg = $_ . '/valgrind';
11 my $ver = qx/$vg --version/;
12 if ($ver =~ s/^valgrind-//) {
13 $ver = join '', map chr, split /\./, $ver;
27 my $BUILD_REQUIRES = {
28 'ExtUtils::MakeMaker' => 0,
33 my $tometa = ' >> $(DISTVNAME)/META.yml;';
34 my $build_req = 'echo "build_requires:" ' . $tometa;
35 foreach my $mod ( sort { lc $a cmp lc $b } keys %$BUILD_REQUIRES ) {
36 my $ver = $BUILD_REQUIRES->{$mod};
37 $build_req .= sprintf 'echo " %-30s %s" %s', "$mod:", $ver, $tometa;
42 my $supp = 'lib/Test/Valgrind/Suppressions';
43 open my $tpl, '<', $supp . '.tpl' or die "open($supp.tpl): $!";
44 open my $out, '>', $supp . '.pm' or die "open($supp.pm): $!";
46 s/(VG_PATH\s*=>\s*)undef/$1'$vg'/g;
52 $supp = 'Test/Valgrind/perlTestValgrind.supp';
55 NAME => 'Test::Valgrind',
56 AUTHOR => 'Vincent Pit <perl@profvince.com>',
58 VERSION_FROM => 'lib/Test/Valgrind.pm',
59 ABSTRACT_FROM => 'lib/Test/Valgrind.pm',
60 PL_FILES => { './Gensupp.PL' => 'lib/' . $supp },
62 'lib/Test/Valgrind.pm'
63 => '$(INST_LIB)/Test/Valgrind.pm',
64 'lib/Test/Valgrind/Suppressions.pm'
65 => '$(INST_ARCHLIB)/Test/Valgrind/Suppressions.pm',
66 'lib/' . $supp => '$(INST_ARCHLIB)/' . $supp,
72 'Perl::Destruct::Level' => 0,
76 PREOP => 'pod2text lib/Test/Valgrind.pm > $(DISTVNAME)/README; '
78 COMPRESS => 'gzip -9f', SUFFIX => 'gz',
80 clean => { FILES => "Test-Valgrind-* lib/$supp *.gcov *.gcda *.gcno cover_db" },
82 1 while unlink 'lib/' . $supp;