Installing perl-5.20.1 with Perlbrew. Failed tests in perl5db.t

孤者浪人 提交于 2019-12-22 17:49:58

问题


I am trying to install Perl v5.20.1 with Perlbrew, but it fails due to failed tests in a script perl5db.t. I am using Ubuntu 14.04 with 64 bit architecture (x86_64).

Running:

$ perlbrew install perl-5.20.1

started installation fine and run for some minutes, but then aborted due to failed tests. Output:

Test Summary Report
-------------------
../lib/perl5db.t                                                (Wstat: 0 Tests: 119 Failed: 86)
  Failed tests:  19-56, 58-60, 63-64, 66, 68-72, 74, 76-80
                82-83, 85-101, 104-108, 110, 112, 114, 116-119
Files=2409, Tests=699745, 550 wallclock secs (34.45 usr  3.70 sys + 264.29 cusr 27.76 csys = 330.20 CPU)
Result: FAIL

From ~/perl5/perlbrew/build.perl-5.20.1.log I can see that the first failed test is:

# Failed test 19 - Can set breakpoint in a line in the middle of the file. at ../lib/perl5db.t line 555
#      got 'In MyModule.
# In Main File.
# '
# expected /(?^msx:
#         ^Var=Bar$
#             .*
#         ^In\ MyModule\.$
#             .*
#         ^In\ Main\ File\.$
#             .*
#         )/

Update

I think I found more details about what causes the problem. I traced the problem by debugging the test script /home/hakon/perl5/perlbrew/build/perl-5.20.1/lib/perl5db.t in the build directory.

The script perl5db.t is a script to test that the Perl debugger is working. The first failed test occurs when it tests if it can set a breakpoint on a line in the middle of a file. The file /home/hakon/perl5/perlbrew/build/perl-5.20.1/lib/perl5db/t/filename-line-breakpoint looks like:

use strict;
use warnings;

use MyModule;

my $x = "Foo";

MyModule::function();

print "In Main File.\n";

and the included module MyModule.pm is:

package MyModule;

use strict;
use warnings;

use vars qw($var);

$var = "Bar";

sub function
{
    print "In MyModule.\n";
}

1;

The test script then runs Perl on the script using the -d switch and the following commands to the debugger:

b ../lib/perl5db/t/MyModule.pm:12
c
do { use IO::Handle; STDOUT->autoflush(1); print "Var=$var\n"; }
c
q

It expects the output from the debugger to be like (that is: matching) :

qr/
        ^Var=Bar$
            .*
        ^In\ MyModule\.$
            .*
        ^In\ Main\ File\.$
            .*
        /msx

But it gets:

In MyModule.
In Main File.

which does not match. So the problem is likely to be the

do { use IO::Handle; STDOUT->autoflush(1); print "Var=$var\n"; }

command, which does not produce any output at all..


回答1:


This issue was most likely due to a bug in perl5db.t which expected the environment variable PERLDB_OPTS to be empty. But for my case it was not empty, but set to NonStop causing malfunction of the test script.



来源:https://stackoverflow.com/questions/28433032/installing-perl-5-20-1-with-perlbrew-failed-tests-in-perl5db-t

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!