summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2005-07-25 14:34:12 +0000
committerSteve Hay <SteveHay@planit.com>2005-07-25 14:34:12 +0000
commit5c71b354394b716d454ace0c48305ad74467e50e (patch)
tree7868c6650262ef5473b8a5f7c2680a4ebdfd5834
parentdf76848ee32b55bf5d182b087f9159faa8bd33f8 (diff)
downloadperl-5c71b354394b716d454ace0c48305ad74467e50e.tar.gz
Ken pointed out that CBuilder's cleanup is too agrressive
The Windows compile() and link() methods bizarrely include their own output files in the list of files to be cleaned up. Now that they actually are being cleaned up, this isn't ideal ;-) Stop compile() and link() from cleaning up their own output, and reinstate the explicit deletion of those output files in the test scripts. p4raw-id: //depot/perl@25225
-rw-r--r--lib/ExtUtils/CBuilder/Platform/Windows.pm4
-rw-r--r--lib/ExtUtils/CBuilder/t/01-basic.t5
-rw-r--r--lib/ExtUtils/CBuilder/t/02-link.t5
-rw-r--r--lib/ExtUtils/ParseXS/t/basic.t1
4 files changed, 10 insertions, 5 deletions
diff --git a/lib/ExtUtils/CBuilder/Platform/Windows.pm b/lib/ExtUtils/CBuilder/Platform/Windows.pm
index 8c1750fd06..072791e2ff 100644
--- a/lib/ExtUtils/CBuilder/Platform/Windows.pm
+++ b/lib/ExtUtils/CBuilder/Platform/Windows.pm
@@ -122,8 +122,6 @@ sub compile {
use_scripts => 1, # XXX provide user option to change this???
);
- $self->add_to_cleanup($spec{output});
-
$self->normalize_filespecs(
\$spec{source},
\$spec{output},
@@ -196,7 +194,7 @@ sub link {
$self->add_to_cleanup(
grep defined,
- @{[ @spec{qw(output implib explib def_file base_file map_file)} ]}
+ @{[ @spec{qw(implib explib def_file base_file map_file)} ]}
);
foreach my $opt ( qw(output implib explib def_file map_file base_file) ) {
diff --git a/lib/ExtUtils/CBuilder/t/01-basic.t b/lib/ExtUtils/CBuilder/t/01-basic.t
index b13f4d0bdc..39c6e5b1a2 100644
--- a/lib/ExtUtils/CBuilder/t/01-basic.t
+++ b/lib/ExtUtils/CBuilder/t/01-basic.t
@@ -47,7 +47,10 @@ my ($lib, @temps) = $b->link(objects => $object_file,
$lib =~ tr/"'//d;
ok $lib_file, $lib;
-unlink $source_file;
+for ($source_file, $lib_file, $object_file) {
+ tr/"'//d;
+ 1 while unlink;
+}
my @words = $b->split_like_shell(' foo bar');
ok @words, 2;
diff --git a/lib/ExtUtils/CBuilder/t/02-link.t b/lib/ExtUtils/CBuilder/t/02-link.t
index ccfe4ee182..48a63f08b6 100644
--- a/lib/ExtUtils/CBuilder/t/02-link.t
+++ b/lib/ExtUtils/CBuilder/t/02-link.t
@@ -55,7 +55,10 @@ ok $exe_file;
ok my_system($exe_file), 11;
# Clean up
-unlink $source_file;
+for ($source_file, $exe_file, $object_file) {
+ tr/"'//d;
+ 1 while unlink;
+}
sub my_system {
my $cmd = shift;
diff --git a/lib/ExtUtils/ParseXS/t/basic.t b/lib/ExtUtils/ParseXS/t/basic.t
index efaf968434..4c4fce34ec 100644
--- a/lib/ExtUtils/ParseXS/t/basic.t
+++ b/lib/ExtUtils/ParseXS/t/basic.t
@@ -64,6 +64,7 @@ if ($b->have_compiler) {
}
}
}
+ unlink $obj_file;
unlink $lib_file;
} else {
skip "Skipped can't find a C compiler & linker", 1 for 1..7;