GNU bug report logs -
#37476
[PATCH] Document ert test selectors in batch mode
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Sat, 21 Sep 2019 13:10:01 UTC
Severity: normal
Tags: patch
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37476 in the body.
You can then email your comments to 37476 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37476
; Package
emacs
.
(Sat, 21 Sep 2019 13:10:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Kangas <stefan <at> marxist.se>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 21 Sep 2019 13:10:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I think it would be good to document how to use test selectors on the
ert manual page that talks about running tests in batch mode. I came
up with the following suggested patch.
Any comments?
Best regards,
Stefan Kangas
[0001-Document-ert-test-selectors-in-batch-mode.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37476
; Package
emacs
.
(Sun, 22 Sep 2019 13:06:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 37476 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
> I think it would be good to document how to use test selectors on the
> ert manual page that talks about running tests in batch mode. I came
> up with the following suggested patch.
>
> Any comments?
[...]
> -If ERT is not part of your Emacs distribution, you may need to use
> +You can specify selectors to only run a subset of your tests
> +(@pxref{Test Selectors}). For example, the following would run all
> +tests where the name of the test matches the string ``to-match''.
> +
> +@example
> +emacs -batch -l ert -l my-tests.el \
> + -eval '(ert-run-tests-batch-and-exit "to-match")'
> +@end example
I guess that would be nice to have documented, but it's not a use case
I've ever had. Tests are usually grouped in separate files, so you'd
usually have (as in Emacs) "make foo-tests" or whatever in your
Makefiles.
> +If you are using a version of Emacs older than 24.1, ERT is not part
> +of your Emacs distribution. In this case, you may need to use
The Emacs manuals usually document what's currently in Emacs, so it's a
bit odd to be talking about Emacs 24.1 here, isn't it? So perhaps that
paragraph should just be removed?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37476
; Package
emacs
.
(Sun, 22 Sep 2019 13:40:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 37476 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> > -If ERT is not part of your Emacs distribution, you may need to use
> > +You can specify selectors to only run a subset of your tests
> > +(@pxref{Test Selectors}). For example, the following would run all
> > +tests where the name of the test matches the string ``to-match''.
> > +
> > +@example
> > +emacs -batch -l ert -l my-tests.el \
> > + -eval '(ert-run-tests-batch-and-exit "to-match")'
> > +@end example
>
> I guess that would be nice to have documented, but it's not a use case
> I've ever had. Tests are usually grouped in separate files, so you'd
> usually have (as in Emacs) "make foo-tests" or whatever in your
> Makefiles.
I find that it's sometimes easier to run just one unit test from a
file, since there is less output and therefore less scrolling. I've
had to search the web to find out how to do this before.
I'm not sure I understand the second sentence. Package developers
might have a Makefile similar to the one Emacs core has, which allows
you to easily specify test selectors, but they might also be missing
one.
> > +If you are using a version of Emacs older than 24.1, ERT is not part
> > +of your Emacs distribution. In this case, you may need to use
>
> The Emacs manuals usually document what's currently in Emacs, so it's a
> bit odd to be talking about Emacs 24.1 here, isn't it? So perhaps that
> paragraph should just be removed?
I completely agree, and was simply trying to be conservative. If
that's what we want, I'll be happy to remove it.
Thanks for reviewing the patch.
Best regards,
Stefan Kangas
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37476
; Package
emacs
.
(Sun, 22 Sep 2019 14:47:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 37476 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sun, 22 Sep 2019 15:38:54 +0200
> Cc: 37476 <at> debbugs.gnu.org
>
> > > +If you are using a version of Emacs older than 24.1, ERT is not part
> > > +of your Emacs distribution. In this case, you may need to use
> >
> > The Emacs manuals usually document what's currently in Emacs, so it's a
> > bit odd to be talking about Emacs 24.1 here, isn't it? So perhaps that
> > paragraph should just be removed?
>
> I completely agree, and was simply trying to be conservative. If
> that's what we want, I'll be happy to remove it.
It should be removed, yes.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37476
; Package
emacs
.
(Sun, 22 Sep 2019 17:24:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 37476 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
> I find that it's sometimes easier to run just one unit test from a
> file, since there is less output and therefore less scrolling. I've
> had to search the web to find out how to do this before.
Makes sense. I usually just run unit test inside the running Emacs when
I want to test one specific thing.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Reply sent
to
Stefan Kangas <stefan <at> marxist.se>
:
You have taken responsibility.
(Sat, 28 Sep 2019 16:08:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Stefan Kangas <stefan <at> marxist.se>
:
bug acknowledged by developer.
(Sat, 28 Sep 2019 16:08:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 37476-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> > I find that it's sometimes easier to run just one unit test from a
> > file, since there is less output and therefore less scrolling. I've
> > had to search the web to find out how to do this before.
>
> Makes sense. I usually just run unit test inside the running Emacs when
> I want to test one specific thing.
No more comments in a week, so I've now pushed the attached as commit
cc7f2fb0cc.
(I removed the part about Emacs 24.1.)
Best regards,
Stefan Kangas
[0001-Document-ert-test-selectors-in-batch-mode-Bug-37476.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37476
; Package
emacs
.
(Sun, 29 Sep 2019 11:11:03 GMT)
Full text and
rfc822 format available.
Message #25 received at 37476 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
Hi Stefan,
sorry to enter this thread such late; somehow I've missed it.
> diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
> index 2dbba095d6..889216cbef 100644
> --- a/doc/misc/ert.texi
> +++ b/doc/misc/ert.texi
> @@ -337,10 +337,14 @@ Running Tests in Batch Mode
>
> In quiet mode ERT prints only unexpected results and summary.
>
> -If ERT is not part of your Emacs distribution, you may need to use
> -@code{-L /path/to/ert/} so that Emacs can find it. You may need
> -additional @code{-L} flags to ensure that @code{my-tests.el} and all the
> -files that it requires are on your @code{load-path}.
> +You can specify selectors to only run a subset of your tests
> +(@pxref{Test Selectors}). For example, the following would run all
> +tests where the name of the test matches the string ``to-match''.
> +
> +@example
> +emacs -batch -l ert -l my-tests.el \
> + -eval '(ert-run-tests-batch-and-exit "to-match")'
> +@end example
SELECTOR, if it is a string, is a regular expression. We shall say
so, "... matches the regular expression ...".
> Best regards,
> Stefan Kangas
Best regards, Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37476
; Package
emacs
.
(Sun, 29 Sep 2019 16:35:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 37476 <at> debbugs.gnu.org (full text, mbox):
Hi Michael,
Michael Albinus <michael.albinus <at> gmx.de> writes:
> SELECTOR, if it is a string, is a regular expression. We shall say
> so, "... matches the regular expression ...".
Thanks for pointing that out. I've now changed that on master.
Best regards,
Stefan Kangas
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 28 Oct 2019 11:24:17 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 153 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.