Subject: | Tests fail when PERL_MB_OPT environment variable set |
Date: | Thu, 22 May 2014 00:00:48 +0930 |
To: | bug-Module-Build-Tiny [...] rt.cpan.org |
From: | Andrew Speer <andrew [...] isolutions.com.au> |
If environment variable PERL_MB_OPT is set, e.g.
PERL_MB_OPT=--verbose --install_base=/opt/perl5lib/ --install_path
lib=/opt/perl5lib/ --install_path arch=/opt/perl5lib/
./Build test will fail:
$ ./Build test
t/00-compile.t ..........
1..1
ok 1 - Module/Build/Tiny.pm loaded ok
ok
t/release-pod-syntax.t ..
1..0 # SKIP these tests are for release candidate testing
skipped: these tests are for release candidate testing
t/simple.t ..............
Creating new 'Build' script for 'Foo-Bar' version '0.001'
ok 1 - Ran Build.PL
ok 2 - Build created
ok 3 - Build is executable
ok 4 - Build has shebang line with $^X
ok 5 - _build_params created
ok 6 - Could run Build
ok 7 - Build output looks correctly
ok 8 - created blib
ok 9 - created blib/lib
ok 10 - created blib/script
ok 11 - Foo::Bar copied to blib
ok 12 - pm contents are correct
ok 13 - pm file in blib is readonly
ok 14 - bin/simple copied to blib
ok 15 - blib/script/simple contents are correct
ok 16 - blib/script/simple is executable
ok 17 - script in blib is readonly
ok 18 - blib/script/simple has shebang line with $^X
ok 19 - sharedir has been made
ok 20 - sharedir file has been made
ok 21 - Can run XSub Simple::foo
ok 22 - Could run Build install
not ok 23 - Build install output looks correctly
# Failed test 'Build install output looks correctly'
# at t/simple.t line 128.
# 'Files found in blib/arch: installing files in blib/lib
into architecture dependent library tree
# Installing /opt/perl5lib/auto/Simple/Simple.so
# Installing install/man/man1/simple.1
# Skipping /opt/perl5lib/Foo/Bar.pm (unchanged)
# Skipping /opt/perl5lib/auto/share/dist/Foo-Bar/file.txt (unchanged)
# Installing install/man/man3/Foo::Bar.3pm
# Installing install/bin/simple
# Writing /opt/perl5lib/auto/Foo/Bar/.packlist
# '
# doesn't match '(?-xism:Installing
install\/lib\/perl5\/x86_64\-linux\-thread\-multi\/Foo\/Bar\.pm)'
not ok 24 - Module is installed
ok 25 - Script is installed
1..25
# Failed test 'Module is installed'
# at t/simple.t line 130.
# Looks like you failed 2 tests of 25.
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/25 subtests
Test Summary Report
-------------------
t/simple.t (Wstat: 512 Tests: 25 Failed: 2)
Failed tests: 23-24
Non-zero exit status: 2
Files=3, Tests=26, 1 wallclock secs ( 0.03 usr 0.01 sys + 0.43 cusr
0.05 csys = 0.52 CPU)
Result: FAIL
Suggested solution: undef PERL_MB_OPT in simple.t test. Diff:
$ rcsdiff -u simple.t
===================================================================
RCS file: simple.t,v
retrieving revision 1.1
diff -u -r1.1 simple.t
--- simple.t 2014/05/21 14:27:45 1.1
+++ simple.t 2014/05/21 14:29:23
@@ -10,10 +10,16 @@
use DistGen qw/undent/;
use XSLoader;
+# Unset PERL_MB_OPT env variable which can impact tests
+#
+delete $ENV{'PERL_MB_OPT'};
+
+
#--------------------------------------------------------------------------#
# fixtures
#--------------------------------------------------------------------------#
+
my $dist = DistGen->new(name => 'Foo::Bar');
$dist->chdir_in;
$dist->add_file('share/file.txt', 'FooBarBaz');