[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Finding macro-generated ert test definitions (WAS: [Emacs-diffs] mas
From: |
Noam Postavsky |
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 |
On 23 May 2018 at 10:54, Eli Zaretskii <address@hidden> 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
address@hidden 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
address@hidden) 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.
- Finding macro-generated ert test definitions (WAS: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings.), Noam Postavsky, 2018/05/22
- Re: Finding macro-generated ert test definitions, João Távora, 2018/05/22
- Re: Finding macro-generated ert test definitions (WAS: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings.), Eli Zaretskii, 2018/05/23
- Re: Finding macro-generated ert test definitions (WAS: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings.),
Noam Postavsky <=
- Re: Finding macro-generated ert test definitions (WAS: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings.), Eli Zaretskii, 2018/05/24
- Re: Finding macro-generated ert test definitions, João Távora, 2018/05/24
- Re: Finding macro-generated ert test definitions, Noam Postavsky, 2018/05/24
- Re: Finding macro-generated ert test definitions, João Távora, 2018/05/24