Included patch adds $$ to temporary file and directory names. This fixes this issue. If this is satisfactory, I'll push another version out.
I would still like to know how running unit tests in parallel is useful.
Index: t/10_makefile.t
===================================================================
--- t/10_makefile.t (revision 1612)
+++ t/10_makefile.t (working copy)
@@ -10,11 +10,11 @@
use ExtUtils::MakeMaker;
-my $FILE = 'test-Makefile';
-rmtree( [ qw( tlib troot ) ], 0, 0 );
+my $FILE = "test-$$-Makefile";
+rmtree( [ qw( tlib-$$ troot-$$ ) ], 0, 0 );
END {
$FILE and -f $FILE and unlink $FILE;
- rmtree( [ qw( tlib troot ) ], 0, 0 );
+ rmtree( [ qw( tlib-$$ troot-$$ ) ], 0, 0 );
}
use File::ShareDir::Install;
@@ -29,8 +29,8 @@
WriteMakefile(
NAME => 'File::ShareDir::Install',
VERSION_FROM => 'lib/File/ShareDir/Install.pm',
- INST_LIB => 'tlib/lib',
- PREFIX => 'troot',
+ INST_LIB => "tlib-$$/lib",
+ PREFIX => "troot-$$",
MAKEFILE => $FILE,
PREREQ_PM => {},
($] >= 5.005 ?
@@ -59,7 +59,7 @@
#####
mysystem( $Config{make}, '-f', $FILE );
-my $TOP = "tlib/lib/auto/share";
+my $TOP = "tlib-$$/lib/auto/share";
ok( -f "$TOP/dist/File-ShareDir-Install/honk", "Copied to blib for dist" );
ok( -f "$TOP/module/My-Test/bonk", "Copied to blib for module" );
ok( -f "$TOP/module/My-Test/again", "Copied to blib for module again" );
@@ -79,7 +79,7 @@
}
else {
$TOP = "$1/auto/share";
- $TOP =~ s/\$\(SITEPREFIX\)/troot/;
+ $TOP =~ s/\$\(SITEPREFIX\)/troot-$$/;
ok( -f "$TOP/dist/File-ShareDir-Install/honk", "Copied to blib for dist" );
ok( -f "$TOP/module/My-Test/bonk", "Copied to blib for module" );
ok( -f "$TOP/module/My-Test/again", "Copied to blib for module again" );
Index: t/12_delete.t
===================================================================
--- t/12_delete.t (revision 1612)
+++ t/12_delete.t (working copy)
@@ -10,11 +10,11 @@
use ExtUtils::MakeMaker;
-my $FILE = 'test-Makefile';
-rmtree( [ qw( tlib troot ) ], 0, 0 );
+my $FILE = "test-$$-Makefile";
+rmtree( [ qw( tlib-$$ troot-$$ ) ], 0, 0 );
END {
$FILE and -f $FILE and unlink $FILE;
- rmtree( [ qw( tlib troot ) ], 0, 0 );
+ rmtree( [ qw( tlib-$$ troot-$$ ) ], 0, 0 );
}
use File::ShareDir::Install;
@@ -30,8 +30,8 @@
WriteMakefile(
NAME => 'File::ShareDir::Install',
VERSION_FROM => 'lib/File/ShareDir/Install.pm',
- INST_LIB => 'tlib/lib',
- PREFIX => 'troot',
+ INST_LIB => "tlib-$$/lib",
+ PREFIX => "troot-$$",
MAKEFILE => $FILE,
PREREQ_PM => {},
($] >= 5.005 ?
@@ -60,7 +60,7 @@
#####
mysystem( $Config{make}, '-f', $FILE );
-my $TOP = "tlib/lib/auto/share";
+my $TOP = "tlib-$$/lib/auto/share";
ok( -f "$TOP/module/My-Test/bonk", "Installed this file" );
ok( !-f "$TOP/module/My-Test/again", "Removed this file" );
ok( !-d "$TOP/dist/File-ShareDir-Install/deeper", "Removed a directory" );
Index: t/11_dotfile.t
===================================================================
--- t/11_dotfile.t (revision 1612)
+++ t/11_dotfile.t (working copy)
@@ -10,11 +10,11 @@
use ExtUtils::MakeMaker;
-my $FILE = 'test-Makefile';
-rmtree( [ qw( tlib troot ) ], 0, 0 );
+my $FILE = "test-$$-Makefile";
+rmtree( [ qw( tlib-$$ troot-$$ ) ], 0, 0 );
END {
$FILE and -f $FILE and unlink $FILE;
- rmtree( [ qw( tlib troot ) ], 0, 0 );
+ rmtree( [ qw( tlib-$$ troot-$$ ) ], 0, 0 );
}
use File::ShareDir::Install;
@@ -32,8 +32,8 @@
WriteMakefile(
NAME => 'File::ShareDir::Install',
VERSION_FROM => 'lib/File/ShareDir/Install.pm',
- INST_LIB => 'tlib/lib',
- PREFIX => 'troot',
+ INST_LIB => "tlib-$$/lib",
+ PREFIX => "troot-$$",
MAKEFILE => $FILE,
PREREQ_PM => {},
($] >= 5.005 ?
@@ -61,7 +61,7 @@
#####
mysystem( $Config{make}, '-f', $FILE );
-my $TOP = "tlib/lib/auto/share";
+my $TOP = "tlib-$$/lib/auto/share";
ok( -f "$TOP/dist/File-ShareDir-Install/.something", "Copied a dotfile" );
ok( !-d "$TOP/dist/File-ShareDir-Install/.dir", " ... but not dotdir" );
ok( -d "$TOP/module/My-Test/.dir", "Copied a dotdir" );