Closed m-dango closed 3 weeks ago
Hmm. Is datetime installed? (Check cpan). Which lcov version? (2.1 release or TOT?)
Likely won't tell us anything, but you can also run as
$ LCOV_SHOW_LOCATION=1 per2lcov ...
Which should show the offending line number.
The offending line is https://github.com/linux-test-project/lcov/blob/3abff7c68391c5f92ba3b36a242b4e501a85646f/bin/perl2lcov#L199
The contents of $f->items
in the loop on my env is ("condition", "subroutine", "time", "branch", "statement")
.
lcov was built via git pull, using master at time of writing.
cover --version
/usr/bin/cover version 1.38
perl -MDateTime -E 'say DateTime->VERSION'
1.59
perl2lcov --version
perl2lcov: LCOV version 2.1-7.g3abff7c
Thanks. I figured out the issue - will push a fix shortly.
Meantime: the easiest workaround is to turn that 'die' into a warning or ignorable_error. (Earlier on: I wanted to die on anything unexpected. That may no longer be a Good Idea - but, on the other hand, there are clearly parts of the Devel::Cover datastructure that I don't understand as well as I thought I did.)
Attempting to clean up the issue list.
I think that this bug is fixed in the above commit. If so: please close the issue or describe the remaining problems that need to be addressed. Thanks.
Meantime: the easiest workaround is to turn that 'die' into a warning or ignorable_error.
An even easier workaround may be to edit your cover
command line to include only the perl cover types supported by perl2lcov: perl -MDevel::Cover=-db,$COVER_DB,-coverage,statement,branch,condition,subroutine ...
(i.e., excluding pod
, time
and path
which will hit the die
, in the perl2lcov
version in the lcov/2.1 release).
Not sure if it is easier to modify your regress environment or the perl code - but more options are likely better than fewer.
Closing this issue now. I believe it was fixed in the above commit (SHA e10f1f0) If there is still a problem, please feel free to reopen this issue or file a new one. Please describe the problem in detail and provide a testcase which illustrates the issue, if possible.
When attempting to run
perl2lcov
I receive the errorunexpected data type 'time'
. I've encountered this on several configurations, and have created a Dockerfile to recreate an environment where the issue occurs for me:Using the above, I create code coverage on the following hello world example project: https://replit.com/@m-dango/Perl-DevelCover-Hello-World#t/hello-world.t
I am currently able to temporarily work around the issue by adding a
next if ... eq 'time'
in the relevant loop in the script.