Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html_basic report broken (missing sub headers and package statements) #300

Open
perlpunk opened this issue Jun 16, 2022 · 2 comments
Open

Comments

@perlpunk
Copy link
Contributor

perlpunk commented Jun 16, 2022

I was trying out the html_basic report and noticed that all subroutine headers and package statements are missing from the report. They are not even counted, so that the line numbers are also off.

Unfortunately I cannot reproduce it on my machine, only in a docker container.
registry.opensuse.org/devel/openqa/containers15.3/os-autoinst_dev
It's openSUSE Leap 15.3 with perl 5.26.1

I put together a simple reproducer:

$ cat t/foo.t
use strict;
use warnings;
use Test::More tests => 1;
use Foo;
my $x = Foo::foo(21);
is $x, 42, "x=42";
$ cat lib/Foo.pm
package Foo;
use strict;
use warnings;

sub foo {
    my ($arg) = @_;
    return $arg * 2;
}

1;
$ PERL5OPT=-MDevel::Cover prove -l t/foo.t
...
$ cover -report html_basic cover_db
Reading database from /tmp/autoinst/cover_db


-------------- ------ ------ ------ ------ ------ ------ ------
File             stmt   bran   cond    sub    pod   time  total
-------------- ------ ------ ------ ------ ------ ------ ------
/usr/bin/prove  100.0   50.0    n/a  100.0    n/a   15.7   87.5
lib/Foo.pm      100.0    n/a    n/a  100.0    0.0    0.0   91.6
t/foo.t         100.0    n/a    n/a  100.0    n/a   84.2  100.0
Total           100.0   50.0    n/a  100.0    0.0  100.0   93.1
-------------- ------ ------ ------ ------ ------ ------ ------


HTML output written to /tmp/autoinst/cover_db/coverage.html

Here's a screenshot of the report:
devel-cover-html-basic-report

Installed is Devel::Cover 1.36, but there is no difference when I install 1.38.

When I use this example on my laptop, then I actually get the same bug as reported in #270 , but so far I wasn't able to find out which different module versions are responsible for that.
devel-cover-html-basic-report-one-line

Let me know if you need more information. But if you pull the mentioned docker image, you should be able to reproduce it.

@openstrike
Copy link

I have just installed version 1.38 and can confirm this happens natively too (ie. outside a container).

@WenjingLi2036
Copy link

Adding a switch noppihtml like "cover -report html_basic -noppihtml cover_db" works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants