From unknown Sun Jun 15 10:56:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#76447: 29.4; ert-run-tests-batch now aborts if a test signals an undefined error Resent-From: Philipp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Feb 2025 20:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 76447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 76447@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174008322323887 (code B ref -1); Thu, 20 Feb 2025 20:28:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Feb 2025 20:27:03 +0000 Received: from localhost ([127.0.0.1]:42206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tlD8O-0006Ci-Gg for submit@debbugs.gnu.org; Thu, 20 Feb 2025 15:27:03 -0500 Received: from lists.gnu.org ([2001:470:142::17]:40824) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tlD8L-0006Aw-9M for submit@debbugs.gnu.org; Thu, 20 Feb 2025 15:26:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tlD8C-0004WO-QT for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2025 15:26:49 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tlD8A-0003R0-Sb for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2025 15:26:48 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-439999d2bbfso1944145e9.2 for ; Thu, 20 Feb 2025 12:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740083203; x=1740688003; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=1+AuT8jIyXAhsyBvOELSidXX0ayAJgL3bYmaEhLEvrA=; b=aBt11/6j1iAORi9ZhbsHB6IrnbN431EWvSqlqW2LvwhhMsqQS+YqAxT22qAxiQwL2l nZgmETbr9PRxRMEqEVQ49m2EAvSmPxm6PZ1dqon56S/QI4Omps8WqcD+AJ2wNywPStdl 0oXwjMQhrnPXwLVmfpz0z9F4pvN2HeiHrHJr9bBW10prDWTKcsSZMNWNY5BcAzeXax4/ KONKbY6BkOlWt6tP93G637+0oaWpXSSnD4whhPGGS1ZDZR6TuQZU0mxrnrcSK4XoChnu /JBhpoV+l2s2mYvNTvgpNDwe7zLc53N4VrUP+PWABIE6+4GkfAJ+88FLEexTHRlxa2s3 J1Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740083203; x=1740688003; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1+AuT8jIyXAhsyBvOELSidXX0ayAJgL3bYmaEhLEvrA=; b=NQo+k/XrK4wVI/aFQIRGEafTPWkWYHmhIgWbNVE6s9sKoOaC7Q74ktua2uGJ27ypM2 4JjBNMX3tvhH3cOAkbPV49EzymatxqmrEFcRFV1af97zICQblJ9AldhMVYMAZycc+wLg ZSk0T9XlgUPGAaWA1/id83QcQQtOpHPNOpEi/N9GJOVvPyzyNfNVr5Qeb8JwzJFfVYRx W06LjfB0LKPjctHZ1UkONYoTtoIJlkxPBW4aPdtJoJad7h0heNOxHBtCNzK6ovw4QfYB 6hkQSQlFBm2LkwOCPAFyxbZ3OT6Be3wLJBh5lZDuLYlG+LAdO6M1+l+jm3MEe0HYgP7n 2xXw== X-Gm-Message-State: AOJu0YzlfhDZ2KXN2WJSOLFQw/XBvIIdGghw2FmluMKFrXyae47zpD1b zc6NoUghcWTYGWTm8cEYcqE07AsX9uw1XYw6B9DzNV2FbLXEEdpsLcfM7Q== X-Gm-Gg: ASbGncvCzeemOvTYWckF+LH7utKnuJDhW1DvCsqh6d/oJJL4kODTYsSgv/VVYxblW2B TJetxDTO7cT77s1IrkhgfuDU1FMOTWqGo6soqOaKE3V8UCdMoSJlfrt4Usz64KhhLuhL0THNcRe /s4mEBjm7915NTFb9ACTn8vvEAwIAYDdENFj9VW7umnBB28saGPYwJjOzn+U6XmrKS60E8BM8lM EZoRRgCmM42Be1b+6/wxnCdYd9KqkpJHxYJIDY6PPw6pGA1YxazX67XzsAE/dosq5O3aLzhYqwB 7jegRaaqWoPnf+ZOApJuvYJCr9SjbgS61lTZP8T76Lw1ekR1h2I1PSLpICHL3WpN X-Google-Smtp-Source: AGHT+IEm1jd3VIFpyXzd780m+INN1P8Xz08E+4oFtOjeTOKzOzXJEmlilm/SX3I0wQx0d0r9sK3CAg== X-Received: by 2002:a05:6000:1889:b0:385:de67:229e with SMTP id ffacd0b85a97d-38f6f0be804mr206331f8f.11.1740083202585; Thu, 20 Feb 2025 12:26:42 -0800 (PST) Received: from Philipps-MacBook-Pro.fritz.box ([2001:a61:3a5d:f801:d126:75a0:efc6:a006]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f258cccd3sm21451760f8f.23.2025.02.20.12.26.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2025 12:26:41 -0800 (PST) From: Philipp Date: Thu, 20 Feb 2025 21:26:41 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=p.stephani2@gmail.com; helo=mail-wm1-x32b.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: With Emacs 29.4: $ emacs -Q -batch -eval '(ert-deftest test-1 () (signal (quote foo) nil))' -eval '(ert-deftest test-2 ())' -f ert-run-tests-batch-and-exit Running 2 tests (2025-02-20 21:13:09+0100, selector =?UTF-8?Q?=E2=80=98t=E2=80=99?=) [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (p.stephani2[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (p.stephani2[at]gmail.com) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) With Emacs 29.4: $ emacs -Q -batch -eval '(ert-deftest test-1 () (signal (quote foo) nil))' = -eval '(ert-deftest test-2 ())' -f ert-run-tests-batch-and-exit Running 2 tests (2025-02-20 21:13:09+0100, selector =E2=80=98t=E2=80=99) Test test-1 backtrace: signal(foo nil) (closure (t) nil (signal 'foo nil))() ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test ert-run-test(#s(ert-test :name test-1 :documentation nil :body (clos ert-run-or-rerun-test(#s(ert--stats :selector t :tests [#s(ert-test=20 ert-run-tests(t #f(compiled-function (event-type &rest event-args) # ert-run-tests-batch(nil) ert-run-tests-batch-and-exit() command-line-1(("-eval" "(ert-deftest test-1 () (signal (quote foo)=20 command-line() normal-top-level() Test test-1 condition: (foo) FAILED 1/2 test-1 (0.000060 sec)=20 passed 2/2 test-2 (0.000030 sec) Ran 2 tests, 1 results as expected, 1 unexpected (2025-02-20 21:13:09+0100,= 0.019570 sec) 1 unexpected results: FAILED test-1 With Emacs 30.1 release candidate 1: $ emacs -Q -batch -eval '(ert-deftest test-1 () (signal (quote foo) nil))' = -eval '(ert-deftest test-2 ())' -f ert-run-tests-batch-and-exit Running 2 tests (2025-02-20 21:13:03+0100, selector =E2=80=98t=E2=80=99) Test test-1 aborted with non-local exit ABORTED 1/2 test-1 (0.000073 sec)=20 Aborted: Ran 2 tests, 0 results as expected, 0 unexpected (2025-02-20 21:13= :03+0100, 0.000140 sec) Error running tests backtrace() #f(compiled-function () #)() ert-run-tests-batch-and-exit() command-line-1(("-eval" "(ert-deftest test-1 () (signal (quote foo) nil))= " "-eval" "(ert-deftest test-2 ())" "-f" "ert-run-tests-batch-and-exit")) command-line() normal-top-level() 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. 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 ...)) could be used. The pseudo-condition t should be able to catch all signals. In GNU Emacs 29.4 (build 1, aarch64-apple-darwin24.3.0, NS appkit-2575.40 Version 15.3.1 (Build 24D70)) of 2025-02-20 Repository revision: 6a299b3caceb2c73b932ba73849738faa8c5d975 Repository branch: HEAD Windowing system distributor 'Apple', version 10.3.2575 System Description: macOS 15.3.1 Configured using: 'configure --with-modules --with-xml2 --without-pop --with-mailutils 'CFLAGS=3D-g -O3' LDFLAGS=3D-O3' Configured features: ACL GNUTLS JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP ZLIB Important settings: value of $LANG: de_DE.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug phst skeleton pcase ffap thingatpt url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util url-parse auth-source cl-seq eieio eieio-core cl-macs json map byte-opt gv bytecomp byte-compile url-vars rx message sendmail mailcap yank-media dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader gnutls puny elp dbus xml subr-x compile text-property-search comint ansi-osc ansi-color ring cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 69214 10345) (symbols 48 8174 0) (strings 32 23097 2385) (string-bytes 1 704838) (vectors 16 16338) (vector-slots 8 223298 13523) (floats 8 29 54) (intervals 56 229 0) (buffers 984 10)) From unknown Sun Jun 15 10:56:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#76447: 29.4; ert-run-tests-batch now aborts if a test signals an undefined error Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Mar 2025 12:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Philipp , Stefan Monnier Cc: 76447@debbugs.gnu.org Received: via spool by 76447-submit@debbugs.gnu.org id=B76447.174083189530232 (code B ref 76447); Sat, 01 Mar 2025 12:25:02 +0000 Received: (at 76447) by debbugs.gnu.org; 1 Mar 2025 12:24:55 +0000 Received: from localhost ([127.0.0.1]:34892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1toLtm-0007rW-Pn for submit@debbugs.gnu.org; Sat, 01 Mar 2025 07:24:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40322) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1toLtj-0007qk-7n for 76447@debbugs.gnu.org; Sat, 01 Mar 2025 07:24:53 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1toLtd-0001KH-O0; Sat, 01 Mar 2025 07:24:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=WAG2v2uK5vB3Rik0EMEhUQ/CGridqO+7u48Qwa9zNmA=; b=a4U2l48n239dSH9W97Xh G/vsG/edrmrQfkhC9iMOslnQ1Xu9CZoobVo8ZN9R+9FaPwOpTytPXRBmfl0sHqVjKu9+rwtVwow11 3laSnveRCjep8EdiSSykjB2WJT8z/yP6oS/p6wR+fQgwu9jZaPPXpsR/eWySuqg1hqx/mikuAM/KR neThsni8eelY/AmsNXFNB6U0CucE+oaxqkZ1RPBNfO5MBZh9xFCwi2X/3/b/P+BYZO5F3DHE+JQjb q3UMA8GCCT+o2g+URb5wplZ/L2kSM9qVY7bcIpSuq4eGaLXGJeURF4G7hsxG3NB648JWOhobJTPhi i6mrOM9XwRUrjQ==; Date: Sat, 01 Mar 2025 14:24:42 +0200 Message-Id: <86frjxos51.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Philipp on Thu, 20 Feb 2025 21:26:41 +0100) References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philipp > Date: Thu, 20 Feb 2025 21:26:41 +0100 > > > With Emacs 29.4: > > $ emacs -Q -batch -eval '(ert-deftest test-1 () (signal (quote foo) nil))' -eval '(ert-deftest test-2 ())' -f ert-run-tests-batch-and-exit > Running 2 tests (2025-02-20 21:13:09+0100, selector ‘t’) > Test test-1 backtrace: > signal(foo nil) > (closure (t) nil (signal 'foo nil))() > ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test > ert-run-test(#s(ert-test :name test-1 :documentation nil :body (clos > ert-run-or-rerun-test(#s(ert--stats :selector t :tests [#s(ert-test > ert-run-tests(t #f(compiled-function (event-type &rest event-args) # > ert-run-tests-batch(nil) > ert-run-tests-batch-and-exit() > command-line-1(("-eval" "(ert-deftest test-1 () (signal (quote foo) > command-line() > normal-top-level() > Test test-1 condition: > (foo) > FAILED 1/2 test-1 (0.000060 sec) > passed 2/2 test-2 (0.000030 sec) > > Ran 2 tests, 1 results as expected, 1 unexpected (2025-02-20 21:13:09+0100, 0.019570 sec) > > 1 unexpected results: > FAILED test-1 > > > With Emacs 30.1 release candidate 1: > > $ emacs -Q -batch -eval '(ert-deftest test-1 () (signal (quote foo) nil))' -eval '(ert-deftest test-2 ())' -f ert-run-tests-batch-and-exit > Running 2 tests (2025-02-20 21:13:03+0100, selector ‘t’) > Test test-1 aborted with non-local exit > ABORTED 1/2 test-1 (0.000073 sec) > > Aborted: Ran 2 tests, 0 results as expected, 0 unexpected (2025-02-20 21:13:03+0100, 0.000140 sec) > > Error running tests > backtrace() > #f(compiled-function () #)() > ert-run-tests-batch-and-exit() > command-line-1(("-eval" "(ert-deftest test-1 () (signal (quote foo) nil))" "-eval" "(ert-deftest test-2 ())" "-f" "ert-run-tests-batch-and-exit")) > command-line() > normal-top-level() > > > 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. > > 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 ...)) > > could be used. The pseudo-condition t should be able to catch all > signals. Stefan, any comments? From unknown Sun Jun 15 10:56:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#76447: 29.4; ert-run-tests-batch now aborts if a test signals an undefined error Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Mar 2025 11:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 76447@debbugs.gnu.org, p.stephani2@gmail.com Received: via spool by 76447-submit@debbugs.gnu.org id=B76447.17420370896045 (code B ref 76447); Sat, 15 Mar 2025 11:12:01 +0000 Received: (at 76447) by debbugs.gnu.org; 15 Mar 2025 11:11:29 +0000 Received: from localhost ([127.0.0.1]:39121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttPQK-0001Z2-Im for submit@debbugs.gnu.org; Sat, 15 Mar 2025 07:11:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60510) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttPQI-0001Yb-0b for 76447@debbugs.gnu.org; Sat, 15 Mar 2025 07:11:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ttPQC-0007FU-CZ; Sat, 15 Mar 2025 07:11:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=7Sdz2N3UtqwtBADEjnN8LPIynC7Us6plJfyCi48yqMI=; b=l6nTBstGPIQeYmf8Wk1h wSJPPlw26H+EP+f0+j7/z6jBhbxy5MWEsljOszKiazUvQ+i73FwZwjzvB56RwV+3Sbn8JHQ9kJbay 3EaW8qZOG84ealQzkw1s+4zA86CImZVxQ/aAy2YcQ+LDO2sJuELomD6gqLUtjL6RwXBa+HDK4jUn5 aXdh280ITDBAt77PYW9B9S2GCjo9nQ23tCQbB90evLOzFzS+gti9QdH949CirlTzhLNtDQEufTcae qaFtEP7ZOYC7Gw3jpC46oRNT3zX8Qjdc5067gvg49dmjlFB2MOYE7dOn00pNDcd1ZNxkQywujYj7G krPSoOiDJ9/N7Q==; Date: Sat, 15 Mar 2025 13:11:14 +0200 Message-Id: <868qp6y2el.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <86frjxos51.fsf@gnu.org> (message from Eli Zaretskii on Sat, 01 Mar 2025 14:24:42 +0200) References: <86frjxos51.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! > Cc: 76447@debbugs.gnu.org > Date: Sat, 01 Mar 2025 14:24:42 +0200 > From: Eli Zaretskii > > > From: Philipp > > Date: Thu, 20 Feb 2025 21:26:41 +0100 > > > > > > With Emacs 29.4: > > > > $ emacs -Q -batch -eval '(ert-deftest test-1 () (signal (quote foo) nil))' -eval '(ert-deftest test-2 ())' -f ert-run-tests-batch-and-exit > > Running 2 tests (2025-02-20 21:13:09+0100, selector ‘t’) > > Test test-1 backtrace: > > signal(foo nil) > > (closure (t) nil (signal 'foo nil))() > > ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test > > ert-run-test(#s(ert-test :name test-1 :documentation nil :body (clos > > ert-run-or-rerun-test(#s(ert--stats :selector t :tests [#s(ert-test > > ert-run-tests(t #f(compiled-function (event-type &rest event-args) # > > ert-run-tests-batch(nil) > > ert-run-tests-batch-and-exit() > > command-line-1(("-eval" "(ert-deftest test-1 () (signal (quote foo) > > command-line() > > normal-top-level() > > Test test-1 condition: > > (foo) > > FAILED 1/2 test-1 (0.000060 sec) > > passed 2/2 test-2 (0.000030 sec) > > > > Ran 2 tests, 1 results as expected, 1 unexpected (2025-02-20 21:13:09+0100, 0.019570 sec) > > > > 1 unexpected results: > > FAILED test-1 > > > > > > With Emacs 30.1 release candidate 1: > > > > $ emacs -Q -batch -eval '(ert-deftest test-1 () (signal (quote foo) nil))' -eval '(ert-deftest test-2 ())' -f ert-run-tests-batch-and-exit > > Running 2 tests (2025-02-20 21:13:03+0100, selector ‘t’) > > Test test-1 aborted with non-local exit > > ABORTED 1/2 test-1 (0.000073 sec) > > > > Aborted: Ran 2 tests, 0 results as expected, 0 unexpected (2025-02-20 21:13:03+0100, 0.000140 sec) > > > > Error running tests > > backtrace() > > #f(compiled-function () #)() > > ert-run-tests-batch-and-exit() > > command-line-1(("-eval" "(ert-deftest test-1 () (signal (quote foo) nil))" "-eval" "(ert-deftest test-2 ())" "-f" "ert-run-tests-batch-and-exit")) > > command-line() > > normal-top-level() > > > > > > 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. > > > > 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 ...)) > > > > could be used. The pseudo-condition t should be able to catch all > > signals. > > Stefan, any comments? > > > > From unknown Sun Jun 15 10:56:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#76447: 29.4; ert-run-tests-batch now aborts if a test signals an undefined error Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Mar 2025 14:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 76447@debbugs.gnu.org, Philipp Received: via spool by 76447-submit@debbugs.gnu.org id=B76447.174204762727103 (code B ref 76447); Sat, 15 Mar 2025 14:08:02 +0000 Received: (at 76447) by debbugs.gnu.org; 15 Mar 2025 14:07:07 +0000 Received: from localhost ([127.0.0.1]:42978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttSAK-00072m-L9 for submit@debbugs.gnu.org; Sat, 15 Mar 2025 10:07:06 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13455) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ttSAC-000715-Um for 76447@debbugs.gnu.org; Sat, 15 Mar 2025 10:06:57 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 94E7A1001BD; Sat, 15 Mar 2025 09:57:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1742047074; bh=rv8t2KCyYHNUt7j4oVBjpq20dM67dQ/SrmMJK7AfIuA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=UuW4IyUo+P28U7KZKtC6Jx3866CxV7EC8rU9kLvrC9tDAP9lfgnZzwSLZAPpGBr// ZC7y3ouiUlLfs59Xyr5GafTYwLSQTf9IQ6OLWsnbNRu/P/peJEwTlbw2djS73z45Cl ZFuT5GaCJZY9XBnP7z4WT1CgWbAbk3PaPU6r6R0Uu3nDHX307CC7Xu9Uc289RV12ei udI6MxNxFlqX45zkzfO5hwtfd4P8cwppkr6XDEt6LWSUnrITfQp+q39T8Xsh8fv0Ks +wS6sBZW3aML4H2hSk6c5jdqtReAy5pwoCqx5WRKD7zjMGAOLk8s/bWzG83pqW3M2N T5okscuN5nFzA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 048D31000DF; Sat, 15 Mar 2025 09:57:54 -0400 (EDT) Received: from pastel (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CB47612066F; Sat, 15 Mar 2025 09:57:53 -0400 (EDT) From: Stefan Monnier In-Reply-To: <86frjxos51.fsf@gnu.org> Message-ID: References: <86frjxos51.fsf@gnu.org> Date: Sat, 15 Mar 2025 09:57:52 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.386 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> 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, From unknown Sun Jun 15 10:56:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#76447: 29.4; ert-run-tests-batch now aborts if a test signals an undefined error Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Mar 2025 18:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 76447@debbugs.gnu.org, Eli Zaretskii Received: via spool by 76447-submit@debbugs.gnu.org id=B76447.17421483218897 (code B ref 76447); Sun, 16 Mar 2025 18:06:01 +0000 Received: (at 76447) by debbugs.gnu.org; 16 Mar 2025 18:05:21 +0000 Received: from localhost ([127.0.0.1]:50648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ttsMS-0002JQ-LQ for submit@debbugs.gnu.org; Sun, 16 Mar 2025 14:05:20 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:41375) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ttsMP-0002J8-Ko for 76447@debbugs.gnu.org; Sun, 16 Mar 2025 14:05:18 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-38da6a1a20bso440448f8f.1 for <76447@debbugs.gnu.org>; Sun, 16 Mar 2025 11:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742148311; x=1742753111; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hbf0KTZDxPkFxB4jD6CcTwyEUm7S2/kfvdFJ5UggIOk=; b=fQS87a8fYez439ip52GQmhHsds+mH+RNZCTaf06tLkDnsLljTVnHn6gFPfh9ITKRuJ ShzHngDtf09dCu8IUKp1fspRzn0Ana3IuaulcK2aYLLGhPVyu/k3rWNoPD9GNMWB2sHa lE54UTdet14oGgC9iZSL34uVSh3nQbHo3jHju2+wTbV9Xg9LSa3Go3eLcXTz3a08D9lJ WX5oEmnILAJP7jKSSWd1+LzQYIoX3IB05RAHqkA/LPzFHeNhq1Ny3YrcwnYlJms6c81+ sqDMDNvu3qZU2zWblQix64bqQhjA1vMwN2bsnu3+MBPh1NmB31IzVzsk/7NQVKtqFXge ziIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742148311; x=1742753111; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hbf0KTZDxPkFxB4jD6CcTwyEUm7S2/kfvdFJ5UggIOk=; b=qQQYokjeveaw3HvY7vkAubtX/prZzuP4LxBxDidT0JUh6qqXSYAbo3A9IaDOTmZRv4 ikXZs8ZIY4A2lNi3vE0tsVjA9q71PCyUu5Kk9gr2tK5A1+2pGtSERTorObp9Qe2FJv9C WZuTLdLI+AMsj5NsPFQpJpSJSnsJ4wz/zrdTFAwD39VKmWKqUVK9PcS36XtOZ/YVW5qX qe4+F+PXiQ4ljon97FTwz0SqdMC5Gxxrv0Go1/yzDan9hv9GP+KpeNZNwFzVJWL4xbP2 JpPYOC9AXArKoVlz4wPAn9QXyRb2i73qvekvNTAgjcZSHciTqEBR9n051mOa1dv4udIt Br7w== X-Forwarded-Encrypted: i=1; AJvYcCVOE/pWssjr+YkwNW3FzPklI4bEvTTt4FUOIQouCDM0k9gGCN2kZrl6mg0H5CtYbnQvvvYw6w==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yzprk+rt1/9ZoW3935X3bedbm2qGNeqcRaPzfONKnXlKsz9i72/ mTFtgyE3CtBi+G1gUKcj6hQpVjATUDKf4Rqhj7UqslLv4qz6HLBw X-Gm-Gg: ASbGncu+EOTG7CQPgyYx47HA6xHYiN1mZEiaap4jKIxKigYhpeIKomCh/WQPgNQnIVU XvBvKq3KO7uYrbHsBLh/5cS8x2NcpR3hyo/fM7osIKja8GOHYexgoOlDi/gwGr069AslYZPuU/b PNzf/JoOfXaiVMRoSa5f0XK0znc0cYxyII5/T8rNv6K4tEFmmZQXykYZ2JgRusmw6gIgS8dvw09 XcBkagG3Nq+9oLcNUgDu2MFgDWezI50BQ76YpjZLAJ+GnO6kzH5AnXKW6bUvi7UYficycpNjGGQ enjQOmFf2YThMc+9hm9q2mJWoACIigGE/dAgkcBnD/r/62PumACvpktc5hoQmn2VgFM/z3SHq0c = X-Google-Smtp-Source: AGHT+IGopYt0N2Oad/JaU+gW3wFe4EracmUTQOjbhvd7hwQDe+h1Vys1sImx/sWKdYOIVQODEc/izQ== X-Received: by 2002:a05:600c:3c89:b0:439:a1ce:5669 with SMTP id 5b1f17b1804b1-43d1ecd1cb7mr43519755e9.5.1742148310923; Sun, 16 Mar 2025 11:05:10 -0700 (PDT) Received: from smtpclient.apple ([2001:a61:3a26:fb01:d128:efcd:cb4b:470d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395c8881544sm12341250f8f.43.2025.03.16.11.05.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Mar 2025 11:05:10 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) From: Philipp Stephani In-Reply-To: Date: Sun, 16 Mar 2025 19:04:59 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <86frjxos51.fsf@gnu.org> X-Mailer: Apple Mail (2.3826.400.131.1.6) X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > Am 15.03.2025 um 14:57 schrieb Stefan Monnier = : >=20 >>> 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. >=20 > 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. >=20 > 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? The manual says this about 'signal': The argument ERROR-SYMBOL must be an =E2=80=9Cerror symbol=E2=80=9D--a= symbol defined with =E2=80=98define-error=E2=80=99. So I guess raising an error if the 'error symbol' is not an error symbol = makes sense. It would enforce the 'must' clause.=