GNU bug report logs - #25326
26.0.50; Testcover error when a defcustom value changed

Previous Next

Package: emacs;

Reported by: Gemini Lasswell <gazally <at> runbox.com>

Date: Mon, 2 Jan 2017 00:30:02 UTC

Severity: normal

Found in version 26.0.50

Done: Gemini Lasswell <gazally <at> runbox.com>

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 25326 in the body.
You can then email your comments to 25326 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to stefan <at> merten-home.de, bug-gnu-emacs <at> gnu.org:
bug#25326; Package emacs. (Mon, 02 Jan 2017 00:30: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 stefan <at> merten-home.de, bug-gnu-emacs <at> gnu.org. (Mon, 02 Jan 2017 00:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gemini Lasswell <gazally <at> runbox.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Testcover error when a defcustom value changed
Date: Sun, 01 Jan 2017 16:29:05 -0800
Testcover incorrectly marks symbols declared with defcustom as `1value',
which causes it to signal an error if a customizable value is changed
between uses by code under coverage by Testcover.

This is easy to reproduce using the tests for iCalendar. To reproduce,
starting in your Emacs source directory, with emacs -Q if you like:

M-x testcover-start RET lisp/calendar/icalendar.el RET
C-x C-f test/lisp/calendar/icalendar-tests.el RET
M-x eval-buffer RET
M-x ert RET RET

Result: Every test that varies a customization variable fails with the
message "Value of form marked with ‘1value’ does vary"

There was some discussion of this problem on emacs-devel in 2012 under
the title "testcover: setf-method and treatment of `defcustom'"
including a patch to make Testcover treat defcustom like defvar, which
was never applied, as well as mention of pros and cons of fixing it that
way.

I think that it is best to treat defcustom like defvar, which while it
will create more tan splotches on code where behavior under
customization doesn't get tested, it should also encourage people to
write tests that exercise their customization options.

Here's the patch:

  --- ../emacs/trunk/lisp/emacs-lisp/testcover.el       2012-04-20
19:50:27.000000000 +0200
  +++ /home/stefan/tmp/testcover.el     2012-09-10 08:58:01.000000000 +0200
  @@ -297,7 +297,7 @@
          (push (cadr form) testcover-module-1value-functions))
         (when (eq val 'maybe)
          (push (cadr form) testcover-module-potentially-1value-functions)))
  -     ((memq fun '(defconst defcustom))
  +     ((eq fun 'defconst)
         ;;Define this symbol as 1-valued
         (push (cadr form) testcover-module-constants)
         (testcover-reinstrument-list (cddr form)))

If this patch is applied, there is a workaround for this bug in
lisp/textmodes/rst.el which could be removed.




Reply sent to Gemini Lasswell <gazally <at> runbox.com>:
You have taken responsibility. (Sun, 08 Oct 2017 23:43:02 GMT) Full text and rfc822 format available.

Notification sent to Gemini Lasswell <gazally <at> runbox.com>:
bug acknowledged by developer. (Sun, 08 Oct 2017 23:43:02 GMT) Full text and rfc822 format available.

Message #10 received at 25326-done <at> debbugs.gnu.org (full text, mbox):

From: Gemini Lasswell <gazally <at> runbox.com>
To: 25326-done <at> debbugs.gnu.org
Subject: Re: bug#25326: 26.0.50; Testcover error when a defcustom value changed
Date: Sun, 08 Oct 2017 16:42:23 -0700
Fixed in master, by the patch applied for bug#25316.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 06 Nov 2017 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.