Subject: | Make test running better on Win32 |
The attached patch replaces some UNIX calls with similar perl constructs
(e.g. File::Path instead of rm -rf, etc.). This makes the test suite
run somewhat better on Windows, but there are still issues.
Regards,
Slaven
Subject: | runtests.pm.diff |
--- t/runtests.pm.orig 2007-09-19 10:31:50.281250000 +0200
+++ t/runtests.pm 2007-09-19 10:37:48.406250000 +0200
@@ -2,6 +2,11 @@
use strict;
use warnings;
+use File::Path qw(rmtree);
+use File::Copy qw(cp);
+use File::Glob qw(bsd_glob);
+use File::Basename qw(basename);
+
use Test::More;
use FindBin;
@@ -22,8 +27,12 @@ sub do_tests {
die "Error: No init directory for this test\n" unless -d "$myname.init";
# First create the subdirectory for doing testing
- system "rm -rf $myname.dir" if -d "$myname.dir";
- system "cp -r $myname.init $myname.dir";
+ rmtree "$myname.dir" if -d "$myname.dir";
+ mkdir "$myname.dir" or die "Cannot create $myname.dir: $!";
+ for my $f (bsd_glob("$myname.init/*")) {
+ cp $f, "$myname.dir/" . basename($f)
+ or die "Cannot copy $f to $myname.dir: $!";
+ }
chdir "$myname.dir";