2 # Regression test for a weird build issue where wikitext.pm was installed
3 # as an empty file, possibly caused by parallel builds. This was hopefully
4 # fixed by making the build steps more robust in 3.20180228.
5 # https://buildd.debian.org/status/fetch.php?pkg=ikiwiki&arch=all&ver=3.20180105-1&stamp=1515285462&raw=0
6 # -rw-r--r-- root/root 0 2018-01-06 23:20 ./usr/share/perl5/IkiWiki/Plugin/wikitext.pm
10 use File::Find qw(find);
13 my @libs="IkiWiki.pm";
15 if ($ENV{INSTALLED_TESTS}) {
16 foreach my $libdir (@INC) {
18 return unless /\.pm$/;
19 my $name = $File::Find::name;
20 if ($name =~ s{^\Q$libdir/\E}{}) {
25 if (-e "$libdir/IkiWiki.pm" && -d "$libdir/IkiWiki") {
26 find($wanted, "$libdir/IkiWiki");
34 return unless /\.pm$/;
35 my $name = $File::Find::name;
36 if ($name =~ s{^\Q$cwd/\E}{}) {
40 find($wanted, "$cwd/IkiWiki");
43 plan(tests => scalar @libs);
45 FILE: foreach my $file (@libs) {
46 foreach my $libdir (@INC) {
47 if (-e "$libdir/$file") {
48 ok(-s "$libdir/$file", "$file available in $libdir and not truncated");
52 fail("$file not available in ".join(':', @INC));