bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25471: 26.0.50; Edebug and Testcover give incorrect code coverage re


From: Gemini Lasswell
Subject: bug#25471: 26.0.50; Edebug and Testcover give incorrect code coverage results for code that uses 'unknown
Date: Tue, 17 Jan 2017 13:24:11 -0800

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]