Update of /cvsroot/module-build/Module-Build/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10124/t
Modified Files:
xs.t
Log Message:
Some OS lock dynamic libs when they are loaded so that they cannot be removed (cygwin, MSWin32). This patch fixes it by unloading the lib before trying to remove it in some of the cases (cygwin).
Index: xs.t
===================================================================
RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- xs.t 2 Oct 2005 05:26:07 -0000 1.28
+++ xs.t 9 Oct 2005 01:26:17 -0000 1.29
@@ -52,6 +52,9 @@
is $@, '';
{
+ use DynaLoader;
+ my $librefs_highwater = @DynaLoader::dl_librefs;
+
# Make sure it actually works
eval 'use blib; require ' . $dist->name;
is $@, '';
@@ -67,6 +70,10 @@
$sub = $dist->name->can('xs_version');
ok $sub, "xs_version() function should be defined";
is $sub->(), "0.01", "xs_version() should return the string '0.01'";
+
+ # unload the dll so it can be unlinked
+ DynaLoader::dl_unload_file($DynaLoader::dl_librefs[$librefs_highwater])
+ if DynaLoader->can('dl_unload_file');
}
{
|