5

When running ./Build testcover to test the code coverage, is there a way I can pass in some kind of option for using my own stylesheet, maybe as an override?

I have looked at the Devel::Cover CPAN documentation to no avail.

ardavis
  • 9,842
  • 12
  • 58
  • 112

2 Answers2

5

The CSS file is cover_db/cover.css. Change at will.

ikegami
  • 367,544
  • 15
  • 269
  • 518
  • Yes, I have already thought of that, but it seems tacky to have to change the generated css file. It would be nice if `Devel::Cover` could accept an additional override stylesheet. – ardavis Feb 24 '14 at 19:39
  • You could always copy the HTML files to a directory with the corrected CSS file. – ikegami Feb 24 '14 at 21:19
4

Looking at the source of Devel::Cover::Report::Html_minimal, it seems you would need to make your own report format by subclassing that and overriding print_stylesheet() to do what you want. That's the "easy" part...

Next you would need to get Module::Build to use your custom report format when running cover. Again, looking at the source, the default testcover action in Module::Build simply runs $self->do_system('cover') and as the cover script doesn't allow you to override the report format using an environment variable, you would have to override ACTION_testcover() in the build class for the given module.

It seems like just mangling the default CSS file after running ./Build testcover as suggested in another answer is a much easier solution.

Lasse
  • 686
  • 4
  • 9