GNU bug report logs -
#25471
26.0.50; Edebug and Testcover give incorrect code coverage results for code that uses 'unknown
Previous Next
Reported by: Gemini Lasswell <gazally <at> runbox.com>
Date: Tue, 17 Jan 2017 21:26:02 UTC
Severity: normal
Tags: fixed
Found in version 26.0.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25471 in the body.
You can then email your comments to 25471 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25471
; Package
emacs
.
(Tue, 17 Jan 2017 21:26:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Gemini Lasswell <gazally <at> runbox.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 17 Jan 2017 21:26:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
If you use Edebug or Testcover to gather code coverage information on
code which uses the symbol `unknown', you will get incorrect code
coverage results, because Edebug uses `unknown' internally to represent
forms which have never been evaluated under Edebug.
`unknown' is an obvious name for a Lisp symbol and is used in the Emacs
sources in cedet, calc, cus-edit, elint, erc, gnus and several other
places.
For an example of incorrect code coverage, save this function definition
in a file called bug.el:
(defun how-do-i-know-you (name)
(let ((val 'unknown))
(when (equal name "Bob")
(setq val 'known))
val))
And then use:
M-x testcover-start RET bug.el RET
M-: (how-do-i-know-you "Liz") RET
M-x testcover-mark-all RET RET
The result will be red splotches on the last line of how-do-i-know-you
indicating that Testcover thinks it was never executed.
This could be very simply fixed by changing Edebug to use
`edebug-unknown' instead. The other symbols currently used to record
code coverage are `1value' and `ok-coverage', and they could be changed
respectively to `testcover-1value' and `edebug-ok-coverage'. edebug.el
and testcover.el still wouldn't be able to do code coverage on
themselves, but they should then work for everybody else.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25471
; Package
emacs
.
(Sat, 27 Jul 2019 10:31:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 25471 <at> debbugs.gnu.org (full text, mbox):
Gemini Lasswell <gazally <at> runbox.com> writes:
> If you use Edebug or Testcover to gather code coverage information on
> code which uses the symbol `unknown', you will get incorrect code
> coverage results, because Edebug uses `unknown' internally to represent
> forms which have never been evaluated under Edebug.
I've now fixed this in edebug.el on the trunk.
> For an example of incorrect code coverage, save this function definition
> in a file called bug.el:
>
> (defun how-do-i-know-you (name)
> (let ((val 'unknown))
> (when (equal name "Bob")
> (setq val 'known))
> val))
>
> And then use:
>
> M-x testcover-start RET bug.el RET
> M-: (how-do-i-know-you "Liz") RET
> M-x testcover-mark-all RET RET
However, the testcover case seems to be more complicated. `unknown'
seems straightforward, but there's also `1value' and `maybe' and perhaps
some other symbols that I'm not sure need this or not. `noreturn', for
instance, seems part of the official API and can't be changed... I
think?
I don't use testcover myself. Could you perhaps propose a patch to fix
this?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25471
; Package
emacs
.
(Sat, 06 Feb 2021 11:30:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 25471 <at> debbugs.gnu.org (full text, mbox):
Gemini Lasswell <gazally <at> runbox.com> writes:
> This could be very simply fixed by changing Edebug to use
> `edebug-unknown' instead. The other symbols currently used to record
> code coverage are `1value' and `ok-coverage', and they could be changed
> respectively to `testcover-1value' and `edebug-ok-coverage'. edebug.el
> and testcover.el still wouldn't be able to do code coverage on
> themselves, but they should then work for everybody else.
I've now done the renaming in testcover.el in Emacs 28, too, and the
test case seems to work the same as before, so I'm closing this bug
report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 06 Feb 2021 11:30:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.1, send any further explanations to
25471 <at> debbugs.gnu.org and Gemini Lasswell <gazally <at> runbox.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 06 Feb 2021 11:30:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 06 Mar 2021 12:24:07 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 109 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.