2009-07-31 40 views
1

我对Module :: Build有点新,所以也许我做了错误的事情。当我将我的调度从“test”更改为“testcover”时,我是唯一一个获得警告的人吗? Devel :: Cover中是否存在错误? Module :: Build中是否存在错误?我可能只是做了错误的事情。为什么Module :: Build的testcover会让我“使用未初始化的值”警告?

我使用ActiveState Perl v5.10.0与Module :: Build版本0.31012和Devel :: Cover 0.64和Eclipse 3.4.1与EPIC 0.6.34为我的IDE。

更新:我升级到Module :: Build 0.34,警告仍然输出。

更新:看起来像B :: Deparse中的一个错误。希望有一天它会得到修复。

这里是我的单元测试构建文件:

use strict; 
use warnings; 
use Module::Build; 

my $build = Module::Build->resume (
    properties => { 
    config_dir => '_build', 
    }, 
); 

$build->dispatch('test'); 

当我运行这个单元测试构建文件,我得到下面的输出:

t\MyLib1.......ok 
t\MyLib2.......ok 
t\MyLib3.......ok 
All tests successful. 
Files=3, Tests=24, 0 wallclock secs (0.00 cusr + 0.00 csys = 0.00 CPU) 

但是,当我改变派遣线“ testcover'我得到以下输出,其中总是包含一堆“按位和使用未初始化的值”的警告消息:

Deleting database D:/Documents and Settings/<username>/My Documents/<SNIP>/cover_db 
t\MyLib1.......ok 
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. 
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. 
t\MyLib2.......ok 
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. 
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. 
t\MyLib3.......ok 
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. 
Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. 
All tests successful. 
Files=3, Tests=24, 0 wallclock secs (0.00 cusr + 0.00 csys = 0.00 CPU) 
Reading database from D:/Documents and Settings/<username>/My Documents/<SNIP>/cover_db 

---------------------------- ------ ------ ------ ------ ------ ------ ------ 
File       stmt bran cond sub pod time total 
---------------------------- ------ ------ ------ ------ ------ ------ ------ 
.../lib/ActivePerl/Config.pm 0.0 0.0 0.0 0.0 0.0 n/a 0.0 
...l/lib/ActiveState/Path.pm 0.0 0.0 0.0 0.0 100.0 n/a 4.8 
<SNIP> 
blib/lib/<SNIP>/MyLib2.pm  100.0 90.0 n/a 100.0 100.0 0.0 98.5 
blib/lib/<SNIP>/MyLib3.pm  100.0 90.9 100.0 100.0 100.0 0.6 98.0 
Total       14.4 6.7 3.8 18.3 20.0 100.0 11.6 
---------------------------- ------ ------ ------ ------ ------ ------ ------ 

Writing HTML output to D:/Documents and Settings/<username>/My Documents/<SNIP>/cover_db/coverage.html ... 
done. 
+1

听起来像它可能是`B :: Deparse`中的一个错误。 – 2009-07-31 17:47:23

+0

我刚刚升级了B :: Deparse,并且警告移动到了不同的行号,但它指向与之前模块相同的调用。 – 2009-08-01 00:33:12

+0

我通过电子邮件发送了B :: Deparse的作者。我们必须看看会发生什么。 – 2009-10-22 14:09:12

回答

2

线路是:

$kid = $op->first; 
if ($kid->flags & OPf_SPECIAL # Line 4252 
and ($] < 5.009 ? $kid->pmflags & PMf_SKIPWHITE() 
     : $kid->reflags & RXf_SKIPWHITE())) { 
$exprs[0] = "' '"; 
} 

所以这似乎与$kid->flags没有出于某种原因定义。

如果你

perl -MO=Deparse,-d -e my_test_script 

注意你明白了什么:我只是检查了repository version of B::Deparse,这是0.89版本,而安装的版本我像Perl 5.10 0.83版本。

作为临时措施,您可以备份随AS Perl附带的Deparse.pm并将其替换为当前版本以查看是否有所作为?

0

B的作者:: Deparse发邮件给我,他能够重现错误有以下一行代码:

% perl -MO=Deparse -we '$r = qr/foo/; my @a = split($r, $_)' 
BEGIN { $^W = 1; } 
$r = qr/foo/; 
Use of uninitialized value in bitwise and (&) at /usr/lib/perl/5.10/B/Deparse.pm line 4250. 
my(@a) = split(/$r/, $_, 0); 
-e syntax OK 

然后他问我转发臭虫perlbug。我不知道他在说什么。我希望这不会下降。你们任何一位正在阅读这篇文章的Perl专家都想带着这个球跑出来吗?

相关问题