In writing Galileo I have put some bits of logic into the template (.html.ep
), nothing much, but some. To that end I am wondering if I can include these files in the test coverage analysis.
I have tried some things, the most promising was
HARNESS_PERL_SWITCHES='-MDevel::Cover=+select,\.ep$' prove -l t && cover
but these files are still not being included. Perhaps its not possible, but maybe someone has some ideas.
Devel::Cover uses the file and line information which perl itself uses, so in order to get coverage of the templates the template compilation process would need to set the file and line information correctly. I had a quick look at the Mojo source and didn't see that happening, but I might have been looking in the wrong place.
I don't know much about Mojolicious, but I saw that syntax errors in .ep templates get reported correctly, which is a good sign. If that information comes from perl's usual error reporting then Devel::Cover should also be able to provide coverage information, but I didn't manage to get any either.
If you'd like to open a ticket in github I'll be reminded to look further into it when I have some time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With