From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#24402: should-error doesn't catch all errors Date: Wed, 12 Jul 2017 10:45:14 -0600 Message-ID: <874luhbo4l.fsf@lylat> References: <3654D8E9-D3CB-402B-922F-B132C1871E9F@runbox.com> <596E65D2-E780-43A1-A75B-603B61B6F9F4@runbox.com> <87zickhoco.fsf_-_@lylat> <877eznda7v.fsf@lylat> <874lur0zki.fsf@calancha-pc> <87o9sywtbz.fsf@lylat> <87fue3f9p8.fsf@users.sourceforge.net> <87vamyl3j3.fsf@lylat> <87tw2het1b.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1499877976 479 195.159.176.226 (12 Jul 2017 16:46:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Jul 2017 16:46:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Gemini Lasswell , 24402@debbugs.gnu.org, Tino Calancha To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 12 18:46:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVKm8-00086F-8e for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Jul 2017 18:46:08 +0200 Original-Received: from localhost ([::1]:54711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVKmC-0001Vs-4e for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Jul 2017 12:46:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVKm7-0001Vf-38 for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 12:46:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVKm2-0000hO-0N for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 12:46:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:32989) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVKm1-0000hG-So for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 12:46:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dVKm1-0000S4-Ms for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 12:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Jul 2017 16:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24402 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed patch Original-Received: via spool by 24402-submit@debbugs.gnu.org id=B24402.14998779291670 (code B ref 24402); Wed, 12 Jul 2017 16:46:01 +0000 Original-Received: (at 24402) by debbugs.gnu.org; 12 Jul 2017 16:45:29 +0000 Original-Received: from localhost ([127.0.0.1]:35661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVKlU-0000Qs-Nk for submit@debbugs.gnu.org; Wed, 12 Jul 2017 12:45:28 -0400 Original-Received: from mail-it0-f65.google.com ([209.85.214.65]:34703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVKlT-0000Qg-GC for 24402@debbugs.gnu.org; Wed, 12 Jul 2017 12:45:27 -0400 Original-Received: by mail-it0-f65.google.com with SMTP id o202so2721145itc.1 for <24402@debbugs.gnu.org>; Wed, 12 Jul 2017 09:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=bfBhk6eSEx1mqGzrDrKTjEnkvnS2W6n+VqEiTF5vWks=; b=FHeVcwZHew6ozSLkxhqi1ywZMQKEIWV5YXrXnQRu1w2KrqVlsUId0/2UQAxui+FCH/ i02sBWRwDAK72BFByHnZ5kO29YwPNcEoF3gQprVTgiaR5kc5j6m/G9IJ9qB/8dMLS9d0 pabb4aOQ2bfbQiVnE4/IhSWZ/2+V8xEBhnLEBGty2X7kluQhaHTMwdeEgg9IyPNx+95l yo5XYIyVnkePk6OsMmSXyCJbECq6Ur5CU4hTbYI+fPOyJt0AmakTxwirgHFbKowd8czT 8vzNqhEGHhmjEtizKinNZhYHQ3p4UGIl8YaoOBDPnrUrUj8ZlDfMqvDITBS+0R76w4vA +OLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=bfBhk6eSEx1mqGzrDrKTjEnkvnS2W6n+VqEiTF5vWks=; b=UL4Tg58nTECqCN6H4Y77kQKXMgvUQ30bZHuz5ydFngL2Hxz9PD1D2BhAiPEVV7QOMc g+v84w6lN//dlasB1d13UN3d1KzG3vLQuBEU4tuSJWxDwudeBKabgEgtCQ3P9/xLV8X2 07+CanKPJbD/GgX0UTt3vzqAJX5LEdy3zJ02axSBWDsW+VyopfGCNw1xhu99osV6Kg7J kiaggCUKVRA2Rm7bNq89r4d1kkWVJigWaT0AzqvEh7pY7ysCG1JvJllyg6KOWejAAJ9h C8d699bUauzO3HAyj3agmlUko+PlJUH/Vs3Ja0gLkFl2ibn6zF1wdC8dOyoc0GfdSKg/ yvLA== X-Gm-Message-State: AIVw112VRdn6ewdJdh29qdPdkSPJqUV39rbJn20yLNykMIo/qD/iiiNh v2MoDpjBhDYk4w== X-Received: by 10.107.51.66 with SMTP id z63mr6828542ioz.44.1499877921649; Wed, 12 Jul 2017 09:45:21 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id m15sm1461130iti.9.2017.07.12.09.45.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jul 2017 09:45:20 -0700 (PDT) In-Reply-To: <87tw2het1b.fsf@users.sourceforge.net> (npostavs's message of "Wed, 12 Jul 2017 08:30:56 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134472 Archived-At: npostavs@users.sourceforge.net writes: > Alex writes: > >> npostavs@users.sourceforge.net writes: >> >>> Yes, ert binds `debugger' in order to get full backtrace information >>> when there is an error. This means it won't see errors caught by >>> condition-case. That's good when it ignores errors caught by test code >>> using condition-case, but does give rise to problems. There is some >>> relevant discussion in Bugs #11218 and #24617. >>> >>> Espcially the suggestion in #24617 of using `signal-hook-function' to >>> record error info instead of using `debugger', I think doing this could >>> simplify things a lot. It is definitely going to require messing around >>> with ert's internals though... >> >> Thanks for the info. I may have discovered a workaround, but I'm not >> sure if there's any negative side-effects. All the tests pass, though. >> >> What do you think of it? It's obviously not ideal, but I think it at >> least fixes the issues at hand. > > Does it also work when loading the elc version of the test file? (try > 'make check TEST_LOAD_EL=no') Oh, it doesn't load the elc version by default? That's surprising; I think that should be documented in the test README. I get 3 test failures with TEST_LOAD_EL=no, but I don't believe they're because of me. On a mostly clean master (d014a5e15) those 3 also error. One of them is simple to fix (the (require 'subr-x) should not be inside eval-when-compile in dom-tests). The other failing tests are subr-test-backtrace-integration-test and cl-lib-defstruct-record. > What about tests like this? > > (ert-deftest check-error-handling () > (should > (eq 42 > (condition-case () > (/ 1 0) > (arith-error 42))))) It works for me, yes. As long as `debugger' is set to a symbol. I can make it a bit more robust by using an additional defvar in ert--run-test-internal. Are you asking because it doesn't work for you?