Subject: | Test::Data t/array.t fails on Win32 |
Distro: Test-Data-1.17
C:\Temp\other>perl -v
This is perl, v5.8.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2002, Larry Wall
Binary build 806 provided by ActiveState Corp. http://www.ActiveState.com
Built 00:45:44 Mar 31 2003
##########################################################
While trying to install Test::Data via the cpan shell, I encountered the following errors during 'nmake test':
C:\WINNT\system32\nmake.EXE -- OK
Running make test
L:\Mall_Bldg2\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_har
ness(0, 'blib\lib', 'blib\arch')" t\array.t t\function.t t\hash.t t\import.t t\l
oad.t t\pod.t t\prereq.t t\scalar.t
t\array.......NOK 2
# Failed test (t\array.t at line 103)
# STDERR is:
# # Failed test (t\array.t at line 78)
# # Failed test (t\array.t at line 79)
# # Failed test (t\array.t at line 92)
# # Failed test (t\array.t at line 93)
#
# not:
# # Failed test (t/array.t at line 78)
# # Failed test (t/array.t at line 79)
# # Failed test (t/array.t at line 92)
# # Failed test (t/array.t at line 93)
#
# as expected
t\array.......NOK 3
# Failed test (t\array.t at line 145)
# STDERR is:
# # Failed test (t\array.t at line 120)
# # Failed test (t\array.t at line 121)
# # Failed test (t\array.t at line 134)
# # Failed test (t\array.t at line 135)
#
# not:
# # Failed test (t/array.t at line 120)
# # Failed test (t/array.t at line 121)
# # Failed test (t/array.t at line 134)
# # Failed test (t/array.t at line 135)
#
# as expected
t\array.......FAILED tests 2-3
Failed 2/3 tests, 33.33% okay
t\function....ok
t\hash........ok
t\import......ok
t\load........ok
t\pod.........skipped
all skipped: Test::Pod 1.00 required for testing POD
t\prereq......skipped
all skipped: Test::Prereq required to test dependencies
t\scalar......ok
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t\array.t 3 2 66.67% 2-3
2 tests skipped.
Failed 1/8 test scripts, 87.50% okay. 2/114 subtests failed, 98.25% okay.
NMAKE : U1077:
Stop.
C:\WINNT\system32\nmake.EXE test -- NOT OK
Running make install
make test had returned bad status, won't install without force
##########################################################
My diagnosis is that there are tests in t/array.t which are hard-coded for Unix-style path separators (forward slashes) and which need to be coded more flexibly to allow for Win32 (and perhaps pre-OS X MacOS) style separators.
This can be done by adding two lines of code:
use File::Spec;
my $arraypath = File::Spec->catfile("t", "array.t");
... and by changing the 8 offending lines:
:%s/t\/array.t/$arraypath/c
A patch has been provided which has been successfully tested on Win32 and Darwin.
HTH
Jim Keenan
# Patch for http://search.cpan.org/src/BDFOY/Test-Data-1.17/t/array.t
5a6,8
> use File::Spec;
>
> my $arraypath = File::Spec->catfile("t", "array.t");
85,86c88,89
< "# Failed test (t/array.t at line $line{up})",
< "# Failed test (t/array.t at line $line{down})",
---
> "# Failed test ($arraypath at line $line{up})",
> "# Failed test ($arraypath at line $line{down})",
99,100c102,103
< "# Failed test (t/array.t at line $line{up})",
< "# Failed test (t/array.t at line $line{down})",
---
> "# Failed test ($arraypath at line $line{up})",
> "# Failed test ($arraypath at line $line{down})",
127,128c130,131
< "# Failed test (t/array.t at line $line{up})",
< "# Failed test (t/array.t at line $line{down})",
---
> "# Failed test ($arraypath at line $line{up})",
> "# Failed test ($arraypath at line $line{down})",
141,142c144,145
< "# Failed test (t/array.t at line $line{up})",
< "# Failed test (t/array.t at line $line{down})",
---
> "# Failed test ($arraypath at line $line{up})",
> "# Failed test ($arraypath at line $line{down})",