From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#67862: 30.0.50; Handler-bind and ert-test-error-debug Date: Tue, 26 Dec 2023 19:00:34 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33232"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67862@debbugs.gnu.org, Christian Ohler To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 26 19:01:24 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 1rIBk3-0008VF-6q for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Dec 2023 19:01:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIBjl-0007Df-DI; Tue, 26 Dec 2023 13:01:05 -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 1rIBjj-0007DS-WE for bug-gnu-emacs@gnu.org; Tue, 26 Dec 2023 13:01: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 1rIBjj-0001g1-OS for bug-gnu-emacs@gnu.org; Tue, 26 Dec 2023 13:01:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIBjh-0000xu-R6 for bug-gnu-emacs@gnu.org; Tue, 26 Dec 2023 13:01:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Dec 2023 18:01:01 +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.17036136431766 (code B ref 67862); Tue, 26 Dec 2023 18:01:01 +0000 Original-Received: (at 67862) by debbugs.gnu.org; 26 Dec 2023 18:00:43 +0000 Original-Received: from localhost ([127.0.0.1]:34988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIBjO-0000Rb-RN for submit@debbugs.gnu.org; Tue, 26 Dec 2023 13:00:43 -0500 Original-Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:44433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIBjM-00009L-NT for 67862@debbugs.gnu.org; Tue, 26 Dec 2023 13:00:41 -0500 Original-Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5554f268c6cso24970a12.1 for <67862@debbugs.gnu.org>; Tue, 26 Dec 2023 10:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703613636; x=1704218436; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=vHLmAJmcoIqYo9n61odR1Sv8ALziOWomU4a7ue+KI50=; b=KqedE0HTJmNbQTkf/2RhtSmpZtXyLwf0uWbDm/Cta8Ptv3x/1hsHhw49udKIjnMysR siy4jg1b+kX68J0O9fAdkU+eavoTt96iLMLrhRJCQDwiZNLIj3O+04LxrAKKxuWUO4sZ ZJaGRlc/baic39mIfTOD55JRarASoWw814sfs4kFyaZfEWxl+rQcDAHU9ldmaX0WBZPI PvyAFPt11R48Cg/8iB9e5nyIj8TJjQDQS1lCq3iL6YKDnphaUA43pgdPPh2RWvlmYcrH u9rVOpYluV9vVq/wp34+i14/l6Wefp3Uu24UduRkK5y4ka97HTL2Kdnbaq+CwujA6L9J OPOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703613636; x=1704218436; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vHLmAJmcoIqYo9n61odR1Sv8ALziOWomU4a7ue+KI50=; b=NWVlAA+6MyG2y9bgSGSH9UWbabv/DCzoldd1vblCNveOzAhCUml+ojDtcoqSYkNVcS pcdt2ZlNiLTxtSteaoCdhKMtt3d/x4yL4hAWRhAfSLFRbH2fo4qRZlk0YLN369TXjQtL gwwYz/LPxgTFUZ6tdgLE1XZGQ9V5lK384O0UNxcCEX+X06QIKngtKqcB8NoAsTgrFR5y rpvZRt3Hyr30SBoRHb+XEM5zjjnvWVVNM37TuA/aLQeYllLGXPktNMAia0jTqEoFc/oY SCfxqGiJQ0OmALUTFTo0TZYQKI9lsOQCzpBhf4bairuQRgFXW7dEpPObpjLNrmkforXA TFHw== X-Gm-Message-State: AOJu0YyLTl0x9M6itCLgji5o1OjqbgFboz+3ix5TyNqIh3JX0PoP6bEK BuvIIID8q0jV4Crl25M/XEW0vBMZ/eI= X-Google-Smtp-Source: AGHT+IGesSYuXgKJf40fMGrR+IZfr2H5/5e/+t/qSptOyv6KncO563mjG5zI4AqWWuVEwUdT4M6tcQ== X-Received: by 2002:a50:8adc:0:b0:548:e0d0:de86 with SMTP id k28-20020a508adc000000b00548e0d0de86mr5432003edk.39.1703613635898; Tue, 26 Dec 2023 10:00:35 -0800 (PST) Original-Received: from Pro.fritz.box (pd9e36182.dip0.t-ipconnect.de. [217.227.97.130]) by smtp.gmail.com with ESMTPSA id x7-20020a50ba87000000b005527cfaa2dfsm7821701ede.49.2023.12.26.10.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 10:00:35 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Tue, 26 Dec 2023 11:25:22 -0500") 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:276919 Archived-At: Stefan Monnier writes: > 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. That's also what I've seen in ert.el, and how I think things are supposed to work. > 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"? from the fact that the test (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))))) explicitly tests that the handler for `error' sees the "Error message" (last 2 lines of the test), I'd also conjecture that tests intends to check that the debugger does not run in a condition-case. Also, a bit strange is that this: (ert-deftest ert-test-fail-debug-with-condition-case () (let ((test (make-ert-test :body (lambda () (ert-fail "failure message"))))) (condition-case condition (progn (let ((ert-debug-on-error t)) (ert-run-test test)) (cl-assert nil)) ((error) (cl-assert (equal condition '(ert-test-failed "failure message")) t))))) is almost the saem test? (Uses ert-fail instead of error). BTW, there are some more tests in the vicinity of the test above that test if the debugger is/isn't invoked in various circumstances.