From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gemini Lasswell Newsgroups: gmane.emacs.bugs 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 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1484688375 29946 195.159.176.226 (17 Jan 2017 21:26:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Jan 2017 21:26:15 +0000 (UTC) To: 25471@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 17 22:26:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTbGc-0007G6-SQ for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Jan 2017 22:26:11 +0100 Original-Received: from localhost ([::1]:37764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTbGh-00071G-KE for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Jan 2017 16:26:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTbGY-0006zp-Bi for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 16:26:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTbGV-0007H4-3C for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 16:26:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35913) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTbGU-0007Gw-VP for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 16:26:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cTbGU-00025h-LS for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 16:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gemini Lasswell Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Jan 2017 21:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25471 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14846883097972 (code B ref -1); Tue, 17 Jan 2017 21:26:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Jan 2017 21:25:09 +0000 Original-Received: from localhost ([127.0.0.1]:34112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTbFd-00024W-CI for submit@debbugs.gnu.org; Tue, 17 Jan 2017 16:25:09 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTbFb-00024I-Te for submit@debbugs.gnu.org; Tue, 17 Jan 2017 16:25:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTbFV-0006Ux-Ub for submit@debbugs.gnu.org; Tue, 17 Jan 2017 16:25:02 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTbFV-0006Uo-SO for submit@debbugs.gnu.org; Tue, 17 Jan 2017 16:25:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTbFU-0006fs-IM for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 16:25:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTbFQ-0006Qe-GT for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 16:25:00 -0500 Original-Received: from aibo.runbox.com ([91.220.196.211]:45045) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTbFQ-0006O6-9O for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 16:24:56 -0500 Original-Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1cTbFM-0004ru-Pb for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 22:24:52 +0100 Original-Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=rainbow.local) by mailfront10.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1cTbF6-00046Z-PO for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 22:24:37 +0100 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:128184 Archived-At: 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.