From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67862: 30.0.50; Handler-bind and ert-test-error-debug Date: Tue, 26 Dec 2023 11:25:22 -0500 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15749"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Gerd =?UTF-8?Q?M=C3=B6llmann?= , 67862@debbugs.gnu.org To: Christian Ohler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 26 17:43:16 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rIAWR-0003vF-1B for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Dec 2023 17:43:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIAWI-00068j-BS; Tue, 26 Dec 2023 11:43:06 -0500 Original-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 1rIAWG-00068P-Lp for bug-gnu-emacs@gnu.org; Tue, 26 Dec 2023 11:43:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rIAWG-0004xA-Dj for bug-gnu-emacs@gnu.org; Tue, 26 Dec 2023 11:43:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIAWE-0000Qa-Fz for bug-gnu-emacs@gnu.org; Tue, 26 Dec 2023 11:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Dec 2023 16:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67862 X-GNU-PR-Package: emacs Original-Received: via spool by 67862-submit@debbugs.gnu.org id=B67862.17036089421594 (code B ref 67862); Tue, 26 Dec 2023 16:43:02 +0000 Original-Received: (at 67862) by debbugs.gnu.org; 26 Dec 2023 16:42:22 +0000 Original-Received: from localhost ([127.0.0.1]:34835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIAVa-0000Pd-3Y for submit@debbugs.gnu.org; Tue, 26 Dec 2023 11:42:22 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIAVW-0000PM-GF for 67862@debbugs.gnu.org; Tue, 26 Dec 2023 11:42:20 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8B58A442183; Tue, 26 Dec 2023 11:25:26 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1703607925; bh=Yeq37jFF+qnH1KmDRW1PGmNrGiF6b/G7wYMJeEjxZng=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=BYSzjROUDaYA5YX/LomSsQW+3lJ7ZoKb3fp4gUurdCkgSd5sChqzvWjr9cvdQlAG6 ZOCijR82zJFlj2XVUYoqH7YkXaGJVT7StvqcgLSSIjc052OsQM+/lTl5lblCEw00o7 NV+OTdVgQC7hApW8djmyuNVMCkxVG0RtabmhjFyvXR4vMTkLlC+Gaeb/4FCH8xKXQk TwQbGiWDaREI7WAn5Tp6zB1l68KsLUdYOQsnxJCOqSaBL68rUOkZ/AZ3AoG14J4TyP 5wNbz//OyS3ctN2FEwAxtZG5xD1S+VKCrbfRxshjBXTpFmv6Qi8dznUxypRUz4u2Eh PojsR7V8KxO0g== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0F7F1441AE1; Tue, 26 Dec 2023 11:25:25 -0500 (EST) Original-Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D1A8412110F; Tue, 26 Dec 2023 11:25:24 -0500 (EST) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Sun, 17 Dec 2023 07:53:44 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276911 Archived-At: >> (ert-deftest ert-test-error-debug () >> (let ((test (make-ert-test :body (lambda () (error "Error message"))))) >> (condition-case condition >> (progn >> (let ((ert-debug-on-error t)) >> (ert-run-test test)) >> (cl-assert nil)) >> ((error) >> (cl-assert (equal condition '(error "Error message")) t))))) >> >> Until now, this test passes just like that, i.e. without entering >> the debugger. With the new code, this test does enter the debugger. >> >> Can anyone give me a hand figuring out why/how the debugger is not entered >> with the current code? > > Could that be from the condition-case that the test puts around the > ert-run-test? Like in > > (condition-case var > (let ((debug-on-error t)) > (error "error")) > (error "no debugger")) > OK, so now I understand how that test succeeds, but instead I don't understand why it is expected to succeed or more specifically what it is intended to test. AFAICT (let ((ert-debug-on-error t)) (ert-run-test test)) is supposed to say "run the test and please pop up a debugger if there's an error". The ERT code even goes to the trouble to store&use the value of `ert-debug-on-error` upon entry to the tests rather the value that happens to be current when the error is signaled. So to me the code looks like it wants to test that `ert-debug-on-error` indeed brings up a debugger, tho none of the surrounding code tries to detect whether the debugger is/was entered, and instead that surrounding code uses `condition-case` which prevents entering the debugger. Is it really the purpose of this test to make sure that "even if we ask for the debugger, `condition-case` prevents the use of a debugger"? Stefan