oetiker / business-payment-swissesr

A Perl Module to create Swiss ESR invoices.
GNU General Public License v3.0
2 stars 0 forks source link

t/paymentslip.t fails #3

Open eserte opened 8 years ago

eserte commented 8 years ago

Even with all system prereqs satisfied (I think --- tex-luatex and tex-xetex packages are installed) the tests fail on a FreeBSD 10.3 system (various perl vesions):

PERL_DL_NONLAZY=1 /usr/perl5.20.3t/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Variable "$runLaTeX" will not stay shared at /usr/home/eserte/.cpan/build/2016053103/Business-Payment-SwissESR-0.13.0-wv0EpD/t/../lib/Business/Payment/SwissESR/PaymentSlip.pm line 360, <DATA> line 2125.
Variable "$makeEsrLaTeX" will not stay shared at /usr/home/eserte/.cpan/build/2016053103/Business-Payment-SwissESR-0.13.0-wv0EpD/t/../lib/Business/Payment/SwissESR/PaymentSlip.pm line 360, <DATA> line 2125.
pdftotext: not found
md5sum: not found

#   Failed test 'content check'
#   at t/paymentslip.t line 93.
#     ''
#         =~
#     '4d9caec9fff3de1771483a731959c75f'
# Looks like you failed 1 test of 6.
t/paymentslip.t .. 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/6 subtests 
Variable "%parser" will not stay shared at /usr/home/eserte/.cpan/build/2016053103/Business-Payment-SwissESR-0.13.0-wv0EpD/t/../lib/Business/Payment/SwissESR/V11Parser.pm line 308.
t/v11parser.t .... ok
oetiker commented 8 years ago

how can such 'unix environment' requirements be properly encoded for cpan builds ?

eserte commented 7 years ago

The t/paymentslip.t test used also to fail on my Debian/jessie system --- until now, after installing the package texlive-fonts-extra, which apparently provided a required font. Unfortunately there was no message about this problem while running the tests --- I had to use strace resp. hack the Paymentslip module to not remove the temporary directories to see what was happening.

As to the question about specifying unix environment requirements --- unfortunately there's no standard way to do this in CPAN distributions. One can check for the existence of required programs and files in Makefile.PL and fail early if some are missing. To be more user friendly Makefile.PL could print installation instructions for popular operating systems and distributions.

There's also the experimental CPAN plugin CPAN::Plugin::Sysdeps::Mapping which has a manually maintained mapping of CPAN modules to OS package dependencies.