GNU bug report logs - #76447
29.4; ert-run-tests-batch now aborts if a test signals an undefined error

Previous Next

Package: emacs;

Reported by: Philipp <p.stephani2 <at> gmail.com>

Date: Thu, 20 Feb 2025 20:28:01 UTC

Severity: normal

Found in version 29.4

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 76447 <at> debbugs.gnu.org, Philipp <p.stephani2 <at> gmail.com>
Subject: bug#76447: 29.4; ert-run-tests-batch now aborts if a test signals an undefined error
Date: Sat, 15 Mar 2025 09:57:52 -0400
>> test-2 isn't executed.  I think the Emacs 29.4 behavior is more
>> "user-friendly", though this (signaling an error symbol that doesn't
>> derive from 'error') is arguably a corner case.

Indeed, it really should never happen.  Similarly `ignore-errors` will
not catch your `foo` signal.  I don't think it's a problem in ERT.

But maybe we should make `signal` signal an error if the provided
error-symbol is not a valid error condition symbol, as in the patch below?

>> Probably the behavior change is fallout from switching to handler-bind.
>> To restore the Emacs 29.4 behavior, probably a construct such as
>> 
>> (condition-case err
>>     (handler-bind ((t ...)) ...)
>>   (t ...))

I think `(handler-bind ((t ...)) ...)` would be sufficient, since there
is currently no `condition-case` in the corresponding code.


        Stefan


diff --git a/src/eval.c b/src/eval.c
index 5de723cf3bc..6d87d274c31 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1860,6 +1860,8 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool continuable)
     }
 
   conditions = Fget (real_error_symbol, Qerror_conditions);
+  if (NILP (conditions))
+    signal_error ("Invalid error symbol", error_symbol);
 
   /* Remember from where signal was called.  Skip over the frame for
      `signal' itself.  If a frame for `error' follows, skip that,





This bug report was last modified 90 days ago.

Previous Next


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