develooper Front page | perl.perl5.porters | Postings from February 2020

Add a -K run time switch to enable "Kover" mode for Devel::Kover

Thread Next
From:
demerphq
Date:
February 1, 2020 10:04
Subject:
Add a -K run time switch to enable "Kover" mode for Devel::Kover
Message ID:
CANgJU+Uj-K90KqFB5qHYeHF1fqMOOr0b1H3MkjtOPMs0iq3-dA@mail.gmail.com
(16:15:54) pjcj: dmq: Are you looking for something to work on? I've had
something I wanted to do for a while now but haven't quite found the time.
(16:16:31) pjcj: I want to make
https://github.com/Perl/perl5/blob/7c0d7520a3fc24a55344d3234e405cd66e2b3605/pp_ctl.c#L3543
optionally conditional on !in_require so that I can provide coverage
information for top-level statements in modules
(16:17:31) pjcj: I'd be very happy for someone else to do it :)
(16:48:37) dmq: checking
(16:49:33) dmq: can you give me a wee bit more context?
(16:53:28) pjcj: Yeah - if you have a statement in a module, an attribute
with a sub in moose or a route definition in dancer or mojo, for excample,
then the optree gets freed as soon as it has been compiled and run. This
makes it impossible for Devel::Cover to generate coverage data for those
statements and subs.
(16:53:42) pjcj: This is a model which is becoming increasingly popular.
(16:54:17) pjcj: Telling perl not to free those optrees means that we can
later interrogate them and get the coverage information.
(16:54:42) pjcj: But we don't want this on normal runs when the optrees are
useless after being run.
(16:55:40) pjcj: So some sort of switch (-D?) to keep those optrees around
is what I'm after
(16:57:04) dmq: ok, so what is the relationship to !in_require
(16:57:24) dmq: I think i follow everything but that reference... (now that
you explained more)
(16:59:15) pjcj: It's only when in_require is true that I need to not
delete the optree
(16:59:43) pjcj: Now it might be that a more general solution could have
value, but I don't know what the use cases would be for that
(17:01:04) pjcj: It also might be that there are better solutions, but this
was suggested to me by arc and the proof of concept worked
(17:03:27) dmq: right, i clicked right after i asked. makes sense
(17:03:59) dmq: do you care how such a mode is activated? iow, does it have
to be a perl switch? could it be an env var? or just a function called in a
begin?

Implemented as -K. I almost think that -K should also inject 'use
Devel::Cover;' but then we would have to dual life Devel::Cover.

Thoughts appreciated.
Cheers,
Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About