From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: Finding macro-generated ert test definitions (WAS: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings.) Date: Wed, 23 May 2018 18:40:24 -0400 Message-ID: References: <83r2m2cthd.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1527115114 14037 195.159.176.226 (23 May 2018 22:38:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 May 2018 22:38:34 +0000 (UTC) Cc: Alan Mackenzie , Emacs developers , =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , Tino Calancha To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 24 00:38:29 2018 Return-path: Envelope-to: ged-emacs-devel@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 1fLcOq-0003YB-Qa for ged-emacs-devel@m.gmane.org; Thu, 24 May 2018 00:38:28 +0200 Original-Received: from localhost ([::1]:35719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLcQx-00042e-PI for ged-emacs-devel@m.gmane.org; Wed, 23 May 2018 18:40:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLcQm-00041X-Cb for emacs-devel@gnu.org; Wed, 23 May 2018 18:40:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLcQl-0007YN-El for emacs-devel@gnu.org; Wed, 23 May 2018 18:40:28 -0400 Original-Received: from mail-ot0-x233.google.com ([2607:f8b0:4003:c0f::233]:35060) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLcQk-0007XM-0N; Wed, 23 May 2018 18:40:26 -0400 Original-Received: by mail-ot0-x233.google.com with SMTP id h8-v6so27161962otb.2; Wed, 23 May 2018 15:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=J4Mjh/Og0cWrlk15YUkOrPvuNlVHoJG5e08TwuvJQ5I=; b=Y+/ocRReO+g+Dz8InpITkfwSqKjr8wObAK7GBYcG4ZOOz48RmccfD3vEmgccP9R6z6 hTt9Xs7c8W6H2OrrItooLSqHqAH893TTiCJbjJWGP5RNR1IYu6KduDppiKNVETdornjO /lQW1yZQO53DXDq2M2uUgwqojzagsAuVQvpkI4U1/Xo3GX7f69klsVVvQj5XGg/wmNiN rYW5AgPwU1ByEbS6L+lA+9zsygpevYdWBw3B4BMn5KPVM/DHDKS1kYdpFmMmaZGMzyWy UcFiCqBFfnbi3D1wHGu/6fdP6U2sPdruXkA40YG4t9t6lek4N/a8t8KGbb9+55MQSYif F96g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=J4Mjh/Og0cWrlk15YUkOrPvuNlVHoJG5e08TwuvJQ5I=; b=bLbzcE7zxczsU4R0Ql7mONbHBQefwGL4nzYi/T9xVi0snxJqSB/tITSGovAR4XWhjS wA6/iQw5kKiCAdO26XL5oDPFLmBNk0gO+knfu5q6/Yuj/0AZo6Mzuq1zQFKGIeZ2TZUs VbyGEzFdK0FybzBza0ciY+xBqKRdYjkPCiMpE9Y62wHEm1J1bIqsPcJZQ/QYT4kVKxoT YEqM1jUDYBwA5bP3pTPZSwuR1zh40NGbo6okWMUSQCYwNE7hVw+imbyYEVAaqJJ39Ah7 73blRHytwanh6oTglhRTYO7/rO4D2B5DcBl7G5WvmT96Uea9mCFXTWqqsF8voti70GEd lM5g== X-Gm-Message-State: ALKqPwcpzMmSzWbLWU4DzIsNcQFgnzIO3aWEpx95WYYrxnp7kVR3Xupj FswPdpq3784pLrDADXdDFllN3FDuVvzhQ8cmt7/p+g== X-Google-Smtp-Source: AB8JxZpwhmdj1hebmdsjEj9YIeJbCC45MfDYeNR3yD7vxdfFCYKkKEz0NOPKcgL/BRKisJaH7eZOjUR42xoqJopaWto= X-Received: by 2002:a9d:1ec2:: with SMTP id n60-v6mr2821059otn.24.1527115224927; Wed, 23 May 2018 15:40:24 -0700 (PDT) Original-Received: by 2002:a4a:587:0:0:0:0:0 with HTTP; Wed, 23 May 2018 15:40:24 -0700 (PDT) In-Reply-To: <83r2m2cthd.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225636 Archived-At: On 23 May 2018 at 10:54, Eli Zaretskii wrote: >> > Also M-x ert-find-test-other-window could have helped you, but it >> > doesn't (brings me to the beginning of the file, which isn't helpful). I >> > don't know why, does anyone? >> >> It works by searching the source file for "(ert-deftest TEST-NAME", >> but in this case TEST-NAME doesn't occur in the source, it's produced >> at compile time by the define-electric-pair-test macro. >> >> See ert--find-test-regexp and find-function-search-for-symbol. > > WIBNI this was described in ert.texi? It's mostly not ert-specific, although probably worth warning about it. How's this? --- i/doc/misc/ert.texi +++ w/doc/misc/ert.texi @@ -386,5 +386,10 @@ How to Write Tests +@findex ert-find-test-other-window Just like @code{find-function} is only able to find where a function was defined if the function was loaded from a file, ERT is only able -to find where a test was defined if the test was loaded from a file. +to find where a test was defined (via +@code{ert-find-test-other-window}) if the test was loaded from a file. +Since this relies on a textual search of the source, it will likely +fail if you use a macro which expands into the @code{ert-deftest} +form, especially if the test name itself is absent from the source.