使用 Perlbrew 安装 perl-5.20.1.perl5db.t 中的测试失败 [英] Installing perl-5.20.1 with Perlbrew. Failed tests in perl5db.t
问题描述
我正在尝试使用 Perlbrew 安装 Perl v5.20.1,但由于脚本 perl5db.t
中的测试失败而失败.我使用的是 64 位架构 (x86_64) 的 Ubuntu 14.04.
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).
运行:
$ 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
从 ~/perl5/perlbrew/build.perl-5.20.1.log
我可以看到第一个失败的测试是:
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\.$
# .*
# )/
更新
我想我找到了有关导致问题的原因的更多详细信息.我通过调试构建目录中的测试脚本 /home/hakon/perl5/perlbrew/build/perl-5.20.1/lib/perl5db.t
来跟踪问题.
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.
脚本 perl5db.t
是用于测试 Perl 调试器是否正常工作的脚本.第一个失败的测试发生在它测试是否可以在文件中间的一行上设置断点时.文件 /home/hakon/perl5/perlbrew/build/perl-5.20.1/lib/perl5db/t/filename-line-breakpoint
看起来像:
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";
和包含的模块 MyModule.pm
是:
package MyModule;
use strict;
use warnings;
use vars qw($var);
$var = "Bar";
sub function
{
print "In MyModule.\n";
}
1;
然后,测试脚本使用 -d
开关和调试器的以下命令在脚本上运行 Perl:
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
但它得到:
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..
推荐答案
这个问题很可能是由于 bug 在 perl5db.t
中,它期望环境变量 PERLDB_OPTS
为空.但就我而言,它不是空的,而是设置为 NonStop
导致测试脚本出现故障.
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.
这篇关于使用 Perlbrew 安装 perl-5.20.1.perl5db.t 中的测试失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!