GNU bug report logs - #25605
[DRAFT PATCH 1/2] Simplify use of FOR_EACH_TAIL

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Wed, 1 Feb 2017 23:57:01 UTC

Severity: normal

Tags: patch

Done: npostavs <at> users.sourceforge.net

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 25605 in the body.
You can then email your comments to 25605 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 bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Wed, 01 Feb 2017 23:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 01 Feb 2017 23:57:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-gnu-emacs <at> gnu.org
Cc: Paul Eggert <eggert <at> cs.ucla.edu>
Subject: [DRAFT PATCH 1/2] Simplify use of FOR_EACH_TAIL
Date: Wed,  1 Feb 2017 15:56:21 -0800
* src/data.c (circular_list): New function.
* src/lisp.h (FOR_EACH_TAIL): Use Brent’s algorithm and C99 for-loop
decl, to eliminate the need for the args TAIL, TORTOISE and N, and
to speed things up a bit on typical hosts with optimization.
All uses changed.
---
 src/data.c |  6 ++++++
 src/fns.c  | 16 +++++++---------
 src/lisp.h | 34 ++++++++++++++++++++--------------
 3 files changed, 33 insertions(+), 23 deletions(-)

diff --git a/src/data.c b/src/data.c
index 8e07bf0..12dc2df 100644
--- a/src/data.c
+++ b/src/data.c
@@ -170,6 +170,12 @@ args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3)
   xsignal3 (Qargs_out_of_range, a1, a2, a3);
 }
 
+void
+circular_list (Lisp_Object list)
+{
+  xsignal1 (Qcircular_list, list);
+}
+
 
 /* Data type predicates.  */
 
diff --git a/src/fns.c b/src/fns.c
index ac7c1f2..4de74a5 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1544,25 +1544,23 @@ list.
 Write `(setq foo (delq element foo))' to be sure of correctly changing
 the value of a list `foo'.  See also `remq', which does not modify the
 argument.  */)
-  (register Lisp_Object elt, Lisp_Object list)
+  (Lisp_Object elt, Lisp_Object list)
 {
-  Lisp_Object tail, tortoise, prev = Qnil;
-  bool skip;
+  Lisp_Object prev = Qnil;
 
-  FOR_EACH_TAIL (tail, list, tortoise, skip)
+  FOR_EACH_TAIL (list)
     {
-      Lisp_Object tem = XCAR (tail);
+      Lisp_Object tem = XCAR (li.tail);
       if (EQ (elt, tem))
 	{
 	  if (NILP (prev))
-	    list = XCDR (tail);
+	    list = XCDR (li.tail);
 	  else
-	    Fsetcdr (prev, XCDR (tail));
+	    Fsetcdr (prev, XCDR (li.tail));
 	}
       else
-	prev = tail;
+	prev = li.tail;
     }
-  CHECK_LIST_END (tail, list);
   return list;
 }
 
diff --git a/src/lisp.h b/src/lisp.h
index 1ac3816..2d74d44 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3317,6 +3317,7 @@ extern struct Lisp_Symbol *indirect_variable (struct Lisp_Symbol *);
 extern _Noreturn void args_out_of_range (Lisp_Object, Lisp_Object);
 extern _Noreturn void args_out_of_range_3 (Lisp_Object, Lisp_Object,
 					   Lisp_Object);
+extern _Noreturn void circular_list (Lisp_Object);
 extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *);
 enum Set_Internal_Bind {
   SET_INTERNAL_SET,
@@ -4586,20 +4587,25 @@ enum
 	 Lisp_String))							\
      : make_unibyte_string (str, len))
 
-/* Loop over all tails of a list, checking for cycles.
-   FIXME: Make tortoise and n internal declarations.
-   FIXME: Unroll the loop body so we don't need `n'.  */
-#define FOR_EACH_TAIL(hare, list, tortoise, n)	\
-  for ((tortoise) = (hare) = (list), (n) = true;		\
-       CONSP (hare);						\
-       (hare = XCDR (hare), (n) = !(n),				\
-   	((n)							\
-   	 ? (EQ (hare, tortoise)					\
-	    ? xsignal1 (Qcircular_list, list)			\
-	    : (void) 0)						\
-	 /* Move tortoise before the next iteration, in case */ \
-	 /* the next iteration does an Fsetcdr.  */		\
-   	 : (void) ((tortoise) = XCDR (tortoise)))))
+/* Loop over tails of LIST, checking for dotted lists and cycles.
+   In the loop body, ‘li.tail’ is the current cons; the name ‘li’ is
+   short for “list iterator”.  The expression LIST may be evaluated
+   more than once, and so should not have side effects.  The loop body
+   should not modify the list’s top level structure other than by
+   perhaps deleting the current cons.
+
+   Use Brent’s teleporting tortoise-hare algorithm.  See:
+   Brent RP. BIT. 1980;20(2):176-84. doi:10.1007/BF01933190
+   http://maths-people.anu.edu.au/~brent/pd/rpb051i.pdf  */
+
+#define FOR_EACH_TAIL(list)						\
+  for (struct { Lisp_Object tail, tortoise; intptr_t n, max; } li	\
+	 = { list, list, 2, 2 };					\
+       CONSP (li.tail) || (CHECK_LIST_END (li.tail, list), false);	\
+       (li.tail = XCDR (li.tail),					\
+	(li.n-- == 0							\
+	 ? (void) (li.n = li.max <<= 1, li.tortoise = li.tail)		\
+	 : EQ (li.tail, li.tortoise) ? circular_list (list) : (void) 0)))
 
 /* Do a `for' loop over alist values.  */
 
-- 
2.9.3





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Thu, 02 Feb 2017 17:31:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: eggert <at> cs.ucla.edu, 25605 <at> debbugs.gnu.org
Subject: Re: bug#25605: [DRAFT PATCH 1/2] Simplify use of FOR_EACH_TAIL
Date: Thu, 02 Feb 2017 19:29:43 +0200
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Wed,  1 Feb 2017 15:56:21 -0800
> Cc: Paul Eggert <eggert <at> cs.ucla.edu>
> 
> * src/data.c (circular_list): New function.
> * src/lisp.h (FOR_EACH_TAIL): Use Brent’s algorithm and C99 for-loop
> decl, to eliminate the need for the args TAIL, TORTOISE and N, and
> to speed things up a bit on typical hosts with optimization.
> All uses changed.

Thanks, but I wonder if you could add some tests for the relevant
functions, I really feel uneasy about changing the implementation of
such basic functionality without any regression tests.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 05 Feb 2017 21:32:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 25606 <at> debbugs.gnu.org, 25605 <at> debbugs.gnu.org
Subject: patches installed for 25605, 25606
Date: Sun, 5 Feb 2017 13:30:54 -0800
I installed patches for Bug#25605 and Bug#25606, along with all suggested 
revisions to the patches, and am closing the bug reports.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Mon, 06 Feb 2017 16:05:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Mon, 06 Feb 2017 18:04:14 +0200
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Sun, 5 Feb 2017 13:30:54 -0800
> 
> I installed patches for Bug#25605 and Bug#25606, along with all suggested 
> revisions to the patches, and am closing the bug reports.

Thanks.

Any reasons why the tests are in manual/cyclic-tests.el, and not in
src/fns-tests.el?  The tests don't need to be run interactively, do
they?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Tue, 07 Feb 2017 06:54:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Mon, 6 Feb 2017 22:53:35 -0800
Eli Zaretskii wrote:
> Any reasons why the tests are in manual/cyclic-tests.el, and not in
> src/fns-tests.el?

No particular reason, no. I don't know my way around the test directories well; 
please feel free to move them.

> The tests don't need to be run interactively, do
> they?

Only if they fail (i.e., loop forever).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Tue, 07 Feb 2017 12:48:01 GMT) Full text and rfc822 format available.

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

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Tue, 07 Feb 2017 12:47:05 +0000
[Message part 1 (text/plain, inline)]
Paul Eggert <eggert <at> cs.ucla.edu> schrieb am Di., 7. Feb. 2017 um 07:54 Uhr:

>
> > The tests don't need to be run interactively, do
> > they?
>
> Only if they fail (i.e., loop forever).
>
>
If they fail, shouldn't the test runner that runs these tests time out
after some time and mark them as failures?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Tue, 07 Feb 2017 16:33:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Philipp Stephani <p.stephani2 <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Tue, 7 Feb 2017 08:32:27 -0800
On 02/07/2017 04:47 AM, Philipp Stephani wrote:
> If they fail, shouldn't the test runner that runs these tests time out 
> after some time and mark them as failures? 

Not if the test runner is written in elisp. The loops are deep in the C 
code and are immune to elisp timeouts. (I don't know how the test runner 
works.)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Tue, 07 Feb 2017 21:49:02 GMT) Full text and rfc822 format available.

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

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Tue, 07 Feb 2017 21:47:42 +0000
[Message part 1 (text/plain, inline)]
Paul Eggert <eggert <at> cs.ucla.edu> schrieb am Di., 7. Feb. 2017 um 17:32 Uhr:

> On 02/07/2017 04:47 AM, Philipp Stephani wrote:
> > If they fail, shouldn't the test runner that runs these tests time out
> > after some time and mark them as failures?
>
> Not if the test runner is written in elisp. The loops are deep in the C
> code and are immune to elisp timeouts. (I don't know how the test runner
> works.)
>
>
How about running the Emacs binary wrapped in /usr/bin/timeout?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Tue, 07 Feb 2017 22:21:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Philipp Stephani <p.stephani2 <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Tue, 7 Feb 2017 14:20:11 -0800
On 02/07/2017 01:47 PM, Philipp Stephani wrote:
> How about running the Emacs binary wrapped in /usr/bin/timeout?

That should work on GNU platforms. 'timeout' is not a standard program, 
though, and we can't rely on its presence on non-GNU platforms.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Tue, 07 Feb 2017 22:56:01 GMT) Full text and rfc822 format available.

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

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Tue, 07 Feb 2017 22:55:07 +0000
[Message part 1 (text/plain, inline)]
Paul Eggert <eggert <at> cs.ucla.edu> schrieb am Di., 7. Feb. 2017 um 23:20 Uhr:

> On 02/07/2017 01:47 PM, Philipp Stephani wrote:
> > How about running the Emacs binary wrapped in /usr/bin/timeout?
>
> That should work on GNU platforms. 'timeout' is not a standard program,
> though, and we can't rely on its presence on non-GNU platforms.
>
>
This is only for running tests; don't we already require autotools for that
as well? We could also check for it in configure using AC_CHECK_PROGS.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Fri, 10 Feb 2017 10:00:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Fri, 10 Feb 2017 11:59:20 +0200
> Cc: 25606 <at> debbugs.gnu.org, 25605 <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Mon, 6 Feb 2017 22:53:35 -0800
> 
> Eli Zaretskii wrote:
> > Any reasons why the tests are in manual/cyclic-tests.el, and not in
> > src/fns-tests.el?
> 
> No particular reason, no. I don't know my way around the test directories well; 
> please feel free to move them.

Done.  I took the liberty to do the commit in your name, to keep the
attribution of the code to the original author.

Btw, 3 of the new tests fail for me:

  Test test-cycle-lax-plist-get backtrace:
    (setq value-1366 (apply fn-1364 args-1365))
    (unwind-protect (setq value-1366 (apply fn-1364 args-1365)) (setq fo
    (not (unwind-protect (setq value-1366 (apply fn-1364 args-1365)) (se
    (if (not (unwind-protect (setq value-1366 (apply fn-1364 args-1365))
    (let (form-description-1368) (if (not (unwind-protect (setq value-13
    (let ((value-1366 (quote ert-form-evaluation-aborted-1367))) (let (f
    (let ((fn-1364 (function lax-plist-get)) (args-1365 (list d1 2))) (l
    (let ((c1 (cyc1 1)) (c2 (cyc2 1 2)) (d1 (dot1 1)) (d2 (dot2 1 2))) (
    (lambda nil (let ((c1 (cyc1 1)) (c2 (cyc2 1 2)) (d1 (dot1 1)) (d2 (d
    ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
    ert-run-test([cl-struct-ert-test test-cycle-lax-plist-get nil (lambd
    ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test f
    ert-run-tests(t #[385 "\306☻\307\"\203G \211\211G\310U\203¶ \211@\20
    ert-run-tests-batch(nil)
    ert-run-tests-batch-and-exit(nil)
    eval((ert-run-tests-batch-and-exit nil))
    command-line-1(("-L" ";." "-l" "ert" "-l" "src/fns-tests.el" "--eval
    command-line()
    normal-top-level()
  Test test-cycle-lax-plist-get condition:
      (wrong-type-argument listp
			   (1 1 1 1 1 1 1 1 1 1 . tail))
     FAILED  18/31  test-cycle-lax-plist-get
  Test test-cycle-lax-plist-put backtrace:
    (setq value-1570 (apply fn-1568 args-1569))
    (unwind-protect (setq value-1570 (apply fn-1568 args-1569)) (setq fo
    (if (unwind-protect (setq value-1570 (apply fn-1568 args-1569)) (set
    (let (form-description-1572) (if (unwind-protect (setq value-1570 (a
    (let ((value-1570 (quote ert-form-evaluation-aborted-1571))) (let (f
    (let ((fn-1568 (function lax-plist-put)) (args-1569 (list d1 2 2)))
    (let ((c1 (cyc1 1)) (c2 (cyc2 1 2)) (d1 (dot1 1)) (d2 (dot2 1 2))) (
    (lambda nil (let ((c1 (cyc1 1)) (c2 (cyc2 1 2)) (d1 (dot1 1)) (d2 (d
    ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
    ert-run-test([cl-struct-ert-test test-cycle-lax-plist-put nil (lambd
    ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test f
    ert-run-tests(t #[385 "\306☻\307\"\203G \211\211G\310U\203¶ \211@\20
    ert-run-tests-batch(nil)
    ert-run-tests-batch-and-exit(nil)
    eval((ert-run-tests-batch-and-exit nil))
    command-line-1(("-L" ";." "-l" "ert" "-l" "src/fns-tests.el" "--eval
    command-line()
    normal-top-level()
  Test test-cycle-lax-plist-put condition:
      (wrong-type-argument listp
			   (1 1 1 1 1 1 1 1 1 1 . tail))
     FAILED  19/31  test-cycle-lax-plist-put
     passed  20/31  test-cycle-length
     passed  21/31  test-cycle-member
     passed  22/31  test-cycle-memq
     passed  23/31  test-cycle-memql
     passed  24/31  test-cycle-nconc
     passed  25/31  test-cycle-plist-get
     passed  26/31  test-cycle-plist-member
  Test test-cycle-plist-put backtrace:
    (setq value-1504 (apply fn-1502 args-1503))
    (unwind-protect (setq value-1504 (apply fn-1502 args-1503)) (setq fo
    (if (unwind-protect (setq value-1504 (apply fn-1502 args-1503)) (set
    (let (form-description-1506) (if (unwind-protect (setq value-1504 (a
    (let ((value-1504 (quote ert-form-evaluation-aborted-1505))) (let (f
    (let ((fn-1502 (function plist-put)) (args-1503 (list d1 2 2))) (let
    (let ((c1 (cyc1 1)) (c2 (cyc2 1 2)) (d1 (dot1 1)) (d2 (dot2 1 2))) (
    (lambda nil (let ((c1 (cyc1 1)) (c2 (cyc2 1 2)) (d1 (dot1 1)) (d2 (d
    ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
    ert-run-test([cl-struct-ert-test test-cycle-plist-put nil (lambda ni
    ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test f
    ert-run-tests(t #[385 "\306☻\307\"\203G \211\211G\310U\203¶ \211@\20
    ert-run-tests-batch(nil)
    ert-run-tests-batch-and-exit(nil)
    eval((ert-run-tests-batch-and-exit nil))
    command-line-1(("-L" ";." "-l" "ert" "-l" "src/fns-tests.el" "--eval
    command-line()
    normal-top-level()
  Test test-cycle-plist-put condition:
      (wrong-type-argument listp
			   (1 1 1 1 1 1 1 1 1 1 . tail))
     FAILED  27/31  test-cycle-plist-put
     passed  28/31  test-cycle-rassoc
     passed  29/31  test-cycle-rassq
     passed  30/31  test-cycle-reverse
     passed  31/31  test-cycle-safe-length

  Ran 31 tests, 28 results as expected, 3 unexpected (2017-02-10 11:49:19+0200)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 08:32:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 00:31:02 -0800
Eli Zaretskii wrote:
> I took the liberty to do the commit in your name, to keep the
> attribution of the code to the original author.
>
> Btw, 3 of the new tests fail for me:

Although the new tests fail for me too, they succeed if I revert commit 
65298ff4d5861cbc8d88162d58c18fa972b81acf, i.e., the commit that you installed in 
my name. So there must be something wrong with that commit. It would be easy to 
revert the commit but I assume that it was done for a reason so I'll wait for 
you to look into the problem.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 16:13:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 18:13:03 +0200
> Cc: 25606 <at> debbugs.gnu.org, 25605 <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Sun, 12 Feb 2017 00:31:02 -0800
> 
> Eli Zaretskii wrote:
> > I took the liberty to do the commit in your name, to keep the
> > attribution of the code to the original author.
> >
> > Btw, 3 of the new tests fail for me:
> 
> Although the new tests fail for me too, they succeed if I revert commit 
> 65298ff4d5861cbc8d88162d58c18fa972b81acf, i.e., the commit that you installed in 
> my name. So there must be something wrong with that commit.

That's strange.  Before pushing, I verified that I get the same
failures with your original test file.  But maybe I didn't invoke the
test as you intended it to be run.  Here's how I invoke it:

  $ cd test && ../src/emacs -batch -l ert -l manual/cycle-tests.el --eval "(ert-run-tests-batch-and-exit nil)"

If that's wrong, what is the right way of running those tests?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 18:56:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 10:55:00 -0800
Eli Zaretskii wrote:
> what is the right way of running those tests?

"make check". That's what's documented, right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 19:34:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 21:33:48 +0200
> Cc: 25606 <at> debbugs.gnu.org, 25605 <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Sun, 12 Feb 2017 10:55:00 -0800
> 
> Eli Zaretskii wrote:
> > what is the right way of running those tests?
> 
> "make check". That's what's documented, right?

This runs everything, which is too much.  How do I run this single
test?  (AFAIU, it runs each test exactly as I did.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 19:42:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 21:41:18 +0200
> Cc: 25606 <at> debbugs.gnu.org, 25605 <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Sun, 12 Feb 2017 10:55:00 -0800
> 
> Eli Zaretskii wrote:
> > what is the right way of running those tests?
> 
> "make check". That's what's documented, right?

Actually, AFAIU "make check" doesn't run the tests in manual/ at all,
so I'm not sure how you succeeded to run them.  Or maybe I'm missing
something obvious.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 19:42:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 25605 <at> debbugs.gnu.org,
 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 20:41:16 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> "make check". That's what's documented, right?
>
> This runs everything, which is too much.  How do I run this single
> test?  (AFAIU, it runs each test exactly as I did.)

I don't know how to do a single test, but I always run tests from a
single file like so:

larsi <at> mouse:~/src/emacs/trunk/test$ make src/fns-tests

(which hangs for me at present).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 19:44:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 11:43:24 -0800
Eli Zaretskii wrote:
> This runs everything, which is too much.  How do I run this single
> test?

Sorry, I don't know. I didn't have to know, as "make check" sufficed for me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 19:50:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 25605 <at> debbugs.gnu.org,
 25606 <at> debbugs.gnu.org
Subject: Re: bug#25605: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 20:49:01 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> larsi <at> mouse:~/src/emacs/trunk/test$ make src/fns-tests
>
> (which hangs for me at present).

(Hm, doesn't hang after rebuilding Emacs.  But some of the tests fail.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 20:23:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: eggert <at> cs.ucla.edu, 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 22:22:08 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Paul Eggert <eggert <at> cs.ucla.edu>,  25605 <at> debbugs.gnu.org,  25606 <at> debbugs.gnu.org
> Date: Sun, 12 Feb 2017 20:41:16 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> "make check". That's what's documented, right?
> >
> > This runs everything, which is too much.  How do I run this single
> > test?  (AFAIU, it runs each test exactly as I did.)
> 
> I don't know how to do a single test, but I always run tests from a
> single file like so:
> 
> larsi <at> mouse:~/src/emacs/trunk/test$ make src/fns-tests

That's what I do.  But this doesn't work for files in manual/.

> (which hangs for me at present).

(It doesn't hang for me; it fails because 3 tests fail.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Sun, 12 Feb 2017 20:58:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Sun, 12 Feb 2017 12:57:13 -0800
Eli Zaretskii wrote:
> Actually, AFAIU "make check" doesn't run the tests in manual/ at all,
> so I'm not sure how you succeeded to run them.

Well, now that I think back on it, I'm not sure either. I did run them, using 
some complicated set of arguments to 'make', but I don't remember what the 
arguments were.

Anyway, I debugged the tests under the new regime and installed a fix.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Mon, 13 Feb 2017 05:38:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Mon, 13 Feb 2017 07:37:27 +0200
> Cc: 25606 <at> debbugs.gnu.org, 25605 <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Sun, 12 Feb 2017 12:57:13 -0800
> 
> Anyway, I debugged the tests under the new regime and installed a fix.

Thanks, they all pass for me now.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Mon, 13 Feb 2017 09:12:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 25605 <at> debbugs.gnu.org,
 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Mon, 13 Feb 2017 10:11:21 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> > what is the right way of running those tests?
>> 
>> "make check". That's what's documented, right?
>
> This runs everything, which is too much.  How do I run this single
> test?  (AFAIU, it runs each test exactly as I did.)

# make -C test fns-tests SELECTOR=\'test-cycle-lax-plist-get

See also test/README

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25605; Package emacs. (Mon, 13 Feb 2017 14:38:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: eggert <at> cs.ucla.edu, 25605 <at> debbugs.gnu.org, 25606 <at> debbugs.gnu.org
Subject: Re: bug#25606: patches installed for 25605, 25606
Date: Mon, 13 Feb 2017 16:37:18 +0200
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: Paul Eggert <eggert <at> cs.ucla.edu>,  25605 <at> debbugs.gnu.org,  25606 <at> debbugs.gnu.org
> Date: Mon, 13 Feb 2017 10:11:21 +0100
> 
> >> "make check". That's what's documented, right?
> >
> > This runs everything, which is too much.  How do I run this single
> > test?  (AFAIU, it runs each test exactly as I did.)
> 
> # make -C test fns-tests SELECTOR=\'test-cycle-lax-plist-get

Yes, I know.  But that doesn't work for tests under manual/, which is
what I was asking about.




bug closed, send any further explanations to 25605 <at> debbugs.gnu.org and Paul Eggert <eggert <at> cs.ucla.edu> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 18 Feb 2017 19:55:01 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. (Sun, 19 Mar 2017 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 93 days ago.

Previous Next


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