Subject: | necessary test files not copied into blib |
Date: | Mon, 12 May 2014 12:05:31 +0100 |
To: | bug-File-ShareDir [...] rt.cpan.org |
From: | Zefram <zefram [...] fysh.org> |
On a fresh installation, File-ShareDir-1.101 fails its test suite:
$ make test
PERL_DL_NONLAZY=1 /opt/perl-5.18.2/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t xt/*.t
t/01_compile.t .. ok
t/02_main.t ..... 1/30 File 'test_file.txt' does not exist in module dir at t/02_main.t line 94.
# Looks like you planned 30 tests but ran 20.
# Looks like your test exited with 2 just after 20.
t/02_main.t ..... Dubious, test returned 2 (wstat 512, 0x200)
Failed 10/30 subtests
The relevant module code hasn't changed since File-ShareDir-1.03,
which passes its tests, but the installation mechanism has. Here's the
critical difference:
$ perl -Iblib/{arch,lib} -MFile::ShareDir=module_file -lwe 'print File::ShareDir->VERSION; print $INC{"File/ShareDir.pm"}; print module_file("File::ShareDir", "test_file.txt")'
1.101
blib/lib/File/ShareDir.pm
File 'test_file.txt' does not exist in module dir at -e line 1.
$ find blib -name .exists -o -type f -print
blib/lib/File/ShareDir.pm
blib/man3/File::ShareDir.3
$ cd ../File-ShareDir-1.03
$ perl -Iblib/{arch,lib} -MFile::ShareDir=module_file -lwe 'print File::ShareDir->VERSION; print $INC{"File/ShareDir.pm"}; print module_file("File::ShareDir", "test_file.txt")'
1.03
blib/lib/File/ShareDir.pm
blib/lib/auto/share/module/File-ShareDir/test_file.txt
$ find blib -name .exists -o -type f -print
blib/lib/auto/share/module/File-ShareDir/test_file.txt
blib/lib/auto/share/dist/File-ShareDir/subdir/sample.txt
blib/lib/auto/share/dist/File-ShareDir/sample.txt
blib/lib/File/ShareDir.pm
blib/man3/File::ShareDir.3
The file test_file.txt is no longer being copied into blib, so the test
which expects to find it in @INC now fails. However, if some previous
version of File::ShareDir is already installed in the real module
directories, then the test will find the old version's test_file.txt
and pass. The failure is only seen in a fresh installation.
-zefram