Well, that was easier than I thought. I wasn't even half-way through setting up the test case when the error popped up. It's not at the level of merging multiple runs as I expected, but in measuring the coverage of runs on the symlinks themselves. Here's your test case.:
File1
Name: main.pl
Content: print "hi\n"
File2
Name linkdir/main.pl
Content: symlink to File1
Run:
$ perl -MDevel::Cover main.pl
Devel::Cover 0.76: Collecting coverage data for branch, condition, sta
+tement, subroutine and time.
Pod coverage is unavailable. Please install Pod::Coverage from CP
+AN.
Selecting packages matching:
Ignoring packages matching:
/Devel/Cover[./]
Ignoring packages in:
.
/usr/lib/perl5/5.10.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/vendor_perl/5.10.0
/usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi
/usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi
hi
Devel::Cover: Writing coverage database to /path/to/cover_db/runs/1311
+608639.28154
----------------------------------- ------ ------ ------ ------ ------
+ ------
File stmt bran cond sub time
+ total
----------------------------------- ------ ------ ------ ------ ------
+ ------
main.pl 100.0 n/a n/a n/a n/a
+ 100.0
Total 100.0 0.0 0.0 0.0 n/a
+ 100.0
----------------------------------- ------ ------ ------ ------ ------
+ ------
$ perl -MDevel::Cover linkdir/main.pl
Devel::Cover 0.76: Collecting coverage data for branch, condition, sta
+tement, subroutine and time.
Pod coverage is unavailable. Please install Pod::Coverage from CP
+AN.
Selecting packages matching:
Ignoring packages matching:
/Devel/Cover[./]
Ignoring packages in:
.
/usr/lib/perl5/5.10.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/vendor_perl/5.10.0
/usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi
/usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi
hi
Devel::Cover: Writing coverage database to /path/to/cover_db/runs/1311
+608812.28180
----------------------------------- ------ ------ ------ ------ ------
+ ------
File stmt bran cond sub time
+ total
----------------------------------- ------ ------ ------ ------ ------
+ ------
linkdir/main.pl n/a n/a n/a n/a n/a
+ n/a
Total 0.0 0.0 0.0 0.0 n/a
+ 0.0
----------------------------------- ------ ------ ------ ------ ------
+ ------
The problem is measuring code coverage at all when running a symbolically linked script that is not in the current working director. I didn't show the results, but if you run the same symlinked script without running the 'main' non-linked path first, then it captures the coverage. When you run main.pl first, then run linkdir/main.pl next that's when you get the failure.
update: Forgot to mention that you don't get this error when the symlink is in the same directory as what it links to.
--DrWhy
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."