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