Subject: | win32 patch for tools/xml_split/xml_split t/test_xml_split.t t/test_xml_split_g.t t/tools.pm |
win32 patch for tools/xml_split/xml_split t/test_xml_split.t
t/test_xml_split_g.t t/tools.pm
against XML-Twig-3.32, tested, it works :)
Thank you
Subject: | patch.XML-Twig-3.32.txt |
diff -ruN XML-Twig-3.32-clean/t/test_xml_split.t XML-Twig-3.32-new/t/test_xml_split.t
--- XML-Twig-3.32-clean/t/test_xml_split.t 2007-07-20 15:44:42.000000000 -0700
+++ XML-Twig-3.32-new/t/test_xml_split.t 2009-09-14 08:11:53.218750000 -0700
@@ -8,11 +8,11 @@
use lib File::Spec->catdir(File::Spec->curdir,"t");
use tools;
use Config;
-
+my $devnull = File::Spec->devnull;
my $DEBUG=0;
# be cautious: run this only on systems I have tested it on
-my %os_ok=( linux => 1, solaris => 1, darwin => 1);
+my %os_ok=( linux => 1, solaris => 1, darwin => 1, MSWin32 => 1);
if( !$os_ok{$^O}) { print "1..1\nok 1\n"; warn "skipping, test runs only on some OSs\n"; exit; }
if( $] < 5.006) { print "1..1\nok 1\n"; warn "skipping, xml_merge runs only on perl 5.6 and later\n"; exit; }
@@ -21,7 +21,7 @@
my $perl= $Config{perlpath};
if ($^O ne 'VMS') { $perl .= $Config{_exe} unless $perl =~ m/$Config{_exe}$/i; }
-
+$perl = "$^X -Mblib ";
my $xml_split = File::Spec->catfile( "tools", "xml_split", "xml_split");
my $xml_merge = File::Spec->catfile( "tools", "xml_merge", "xml_merge");
@@ -49,13 +49,14 @@
$split_opts ||= '';
$merge_opts ||= '';
$base_nb++;
+ my $verbifdebug = $DEBUG ? '-v' : '';
my $expected_base= File::Spec->catfile( "$test_dir", "test_xml_split_expected-$base_nb");
my $base= File::Spec->catfile( "$test_dir", "test_xml_split-$base_nb");
- systemq( "$perl $xml_split -b $base $split_opts $file");
+ systemq( "$perl $xml_split $verbifdebug -b $base $split_opts $file");
ok( same_files( $expected_base, $base), "xml_split $split_opts $test_file");
- system "$perl $xml_merge -o $base.xml $merge_opts $base-00.xml";
+ system "$perl $xml_merge $verbifdebug -o $base.xml $merge_opts $base-00.xml";
ok( same_file( "$base.xml", $file), "xml_merge $merge_opts $test_file");
unlink( glob( "$base*")) unless( $DEBUG);
@@ -92,7 +93,7 @@
sub systemq
{ if( !$DEBUG)
- { system "$_[0] 1>/dev/null 2>/dev/null"; }
+ { system "$_[0] 1>$devnull 2>$devnull"; }
else
{ warn "$_[0]\n";
system $_[0];
diff -ruN XML-Twig-3.32-clean/t/tools.pm XML-Twig-3.32-new/t/tools.pm
--- XML-Twig-3.32-clean/t/tools.pm 2007-07-20 15:44:42.000000000 -0700
+++ XML-Twig-3.32-new/t/tools.pm 2009-09-14 07:58:00.687500000 -0700
@@ -120,10 +120,11 @@
}
}
+ my $devnull = File::Spec->devnull;
sub sys_ok
{ my $message=pop;
$test_nb++;
- my $status= system join " ", @_, "2>/dev/null";
+ my $status= system join " ", @_, "2>$devnull";
if( !$status)
{ print "ok $test_nb";
print " $message" if( $DEBUG);
diff -ruN XML-Twig-3.32-clean/t/test_xml_split_g.t XML-Twig-3.32-new/t/test_xml_split_g.t
--- XML-Twig-3.32-clean/t/test_xml_split_g.t 2007-07-20 15:44:47.000000000 -0700
+++ XML-Twig-3.32-new/t/test_xml_split_g.t 2009-09-14 08:11:51.515625000 -0700
@@ -8,11 +8,11 @@
use lib File::Spec->catdir(File::Spec->curdir,"t");
use tools;
use Config;
-
+my $devnull = File::Spec->devnull;
my $DEBUG=1;
# be cautious: run this only on systems I have tested it on
-my %os_ok=( linux => 1, solaris => 1, darwin => 1);
+my %os_ok=( linux => 1, solaris => 1, darwin => 1, MSWin32 => 1);
if( !$os_ok{$^O}) { print "1..1\nok 1\n"; warn "skipping, test runs only on some OSs\n"; exit; }
if( $] < 5.006) { print "1..1\nok 1\n"; warn "skipping, xml_merge runs only on perl 5.6 and later\n"; exit; }
@@ -21,7 +21,7 @@
my $perl= $Config{perlpath};
if ($^O ne 'VMS') { $perl .= $Config{_exe} unless $perl =~ m/$Config{_exe}$/i; }
-
+$perl = "$^X -Mblib ";
my $xml_split = File::Spec->catfile( "tools", "xml_split", "xml_split");
my $xml_merge = File::Spec->catfile( "tools", "xml_merge", "xml_merge");
diff -ruN XML-Twig-3.32-clean/tools/xml_split/xml_split XML-Twig-3.32-new/tools/xml_split/xml_split
--- XML-Twig-3.32-clean/tools/xml_split/xml_split 2007-07-20 15:45:01.000000000 -0700
+++ XML-Twig-3.32-new/tools/xml_split/xml_split 2009-09-14 07:52:57.125000000 -0700
@@ -427,6 +427,7 @@
{ my( $state)= @_;
my $nb= sprintf( "%0$state->{nb_digits}d", $state->{seq_nb});
my $file_name= "$state->{base}-$nb$state->{ext}";
+ $file_name =~ s~\\~/~g; # 2009-09-14- 07:52:56
return $file_name;
}