From: "Mattias Engdegård" <mattiase@acm.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 51941@debbugs.gnu.org, Philipp <p.stephani2@gmail.com>
Subject: bug#51941: Detect duplication of ERT tests
Date: Thu, 18 Nov 2021 20:13:59 +0100 [thread overview]
Message-ID: <977035C0-5706-419C-A7D8-88FC9F3B890F@acm.org> (raw)
In-Reply-To: <87mtm1z7dc.fsf@gnus.org>
18 nov. 2021 kl. 18.44 skrev Lars Ingebrigtsen <larsi@gnus.org>:
> By the way, this reminds me of a different error I often make in ert
> files -- I type "defun" instead of "ert-deftest". Would it be
> productive to check whether a -tests.el file contains a defun that's
> never called?
It would certainly be good to detect such mistakes, but I'm not sure how to go about finding them. I wrote a quick-and-dirty scanner that found about 400 uncalled functions in the test tree of which 1 or 2, maybe, should have been `ert-deftest` (will fix those right away).
Clearly something with much better signal/noise ratio is called for. One would be to only consider functions using `should` etc.
> But perhaps it's such a marginal problem that it's not worth checking
> for.
It's unclear how frequent this mistake is but at least now we have concrete evidence of its existence. On the other hand, it will be found by a test author who has adopted the standard "test first without then with the fix" ritual as habit.
(I'm not accusing you of bad discipline; I'm probably no better myself, and in any case berating people for being careless is not how to solve problems caused by human mistakes.)
I may or may not have the time to try to find something better so feel free to take a shot if you like.
next prev parent reply other threads:[~2021-11-18 19:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 10:16 bug#51941: Detect duplication of ERT tests Mattias Engdegård
2021-11-18 10:35 ` Lars Ingebrigtsen
2021-11-18 11:54 ` Mattias Engdegård
2021-11-18 11:58 ` Lars Ingebrigtsen
2021-11-18 17:44 ` Lars Ingebrigtsen
2021-11-18 17:53 ` Philipp Stephani
2021-11-18 19:13 ` Mattias Engdegård [this message]
2021-11-18 19:34 ` Lars Ingebrigtsen
2021-11-18 19:43 ` Mattias Engdegård
2021-11-18 22:51 ` Glenn Morris
2021-11-19 5:28 ` Lars Ingebrigtsen
2021-11-19 9:33 ` Mattias Engdegård
2021-11-20 8:38 ` Lars Ingebrigtsen
2021-11-20 8:49 ` Mattias Engdegård
2021-11-24 7:30 ` Ihor Radchenko
2021-11-24 8:52 ` Mattias Engdegård
2021-11-24 9:29 ` Ihor Radchenko
2021-11-24 10:00 ` Mattias Engdegård
2021-11-24 12:16 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=977035C0-5706-419C-A7D8-88FC9F3B890F@acm.org \
--to=mattiase@acm.org \
--cc=51941@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=p.stephani2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.