]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - Makefile.PL
Use $Config{path_sep} whenever possible
[perl/modules/Test-Valgrind.git] / Makefile.PL
index 1ac71726eae30d9e71bc2f3cbe8b3b752c4754f9..35f78dccc4a4d7b48299b4a47ef0ba4de0f16e84 100644 (file)
@@ -14,7 +14,7 @@ BEGIN {
 
 my $vg;
 print 'Checking for valgrind >= 3.1.0 in PATH... ';
-for (split /:/, $ENV{PATH}) {
+for (split /$Config{path_sep}/, $ENV{PATH}) {
  $_ .= '/valgrind';
  if (-x) {
   my $ver = qx/$_ --version/;
@@ -108,9 +108,10 @@ WriteMakefile(
     PREREQ_PM     => {
         'Carp'                  => 0,
         'Exporter'              => 0,
+        'Fcntl'                 => 0,
         'POSIX'                 => 0,
         'Perl::Destruct::Level' => 0,
-        'Test::More'            => 0,
+        'Test::Builder'         => 0,
     },
     dist          => {
         PREOP      => "touch lib/$supp; "
@@ -124,10 +125,27 @@ WriteMakefile(
 
 package MY;
 
+sub dist_core {
+ my $dist = shift->SUPER::dist_core(@_);
+ $dist =~ s/^(\s*dist\s*:+\s*)/$1testvg_dist /m;
+ return <<DISTCORE . $dist;
+testvg_dist :
+       \$(CP) lib/Test/Valgrind/Suppressions.{tpl,pm}
+       \$(RM) lib/$supp
+       \$(TOUCH) lib/$supp
+DISTCORE
+}
+
+sub test {
+ my $test = shift->SUPER::test(@_);
+ my ($target) = $test =~ /^\s*(test\s*:+)/m;
+ return "$target Makefile.bak blib/archpub/$supp\n$test";
+}
+
 sub postamble {
<<'POSTAMBLE';
return <<POSTAMBLE;
 clean ::
-       $(CP) lib/Test/Valgrind/Suppressions.{tpl,pm}
-       $(TOUCH) lib/Test/Valgrind/perlTestValgrind.supp
+       \$(CP) lib/Test/Valgrind/Suppressions.{tpl,pm}
+       \$(TOUCH) lib/$supp
 POSTAMBLE
 }