GNU bug report logs - #43792
[PATCH] Add ert macros to get resource file names

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Sun, 4 Oct 2020 12:41:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 28.1

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 43792 in the body.
You can then email your comments to 43792 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#43792; Package emacs. (Sun, 04 Oct 2020 12:41: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. (Sun, 04 Oct 2020 12:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add ert macros to get resource file names
Date: Sun, 4 Oct 2020 12:40:33 +0000
[Message part 1 (text/plain, inline)]
Severity: wishlist

There's a lot of repetitive code to get at the resource directories for
tests.  That's obviously boring, so I'd propose something like the
following two macros to make it easier:

(ert-resource-directory)
(ert-resource-file NAME)

Please see the attached patch, the second of which uses the macros in
our test suite.  Not sure if they should be in ert.el, so I put them in
ert-x.el for now to play it safe.

Any comments?
[0001-Add-ert-macros-to-get-resource-file-names.patch (text/x-diff, attachment)]
[0002-Use-new-resource-directory-macros-in-tests.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43792; Package emacs. (Sun, 04 Oct 2020 17:26:01 GMT) Full text and rfc822 format available.

Message #8 received at 43792 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 43792 <at> debbugs.gnu.org
Subject: Re: bug#43792: [PATCH] Add ert macros to get resource file names
Date: Sun, 04 Oct 2020 19:25:50 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

Hi Stefan,

> There's a lot of repetitive code to get at the resource directories for
> tests.  That's obviously boring, so I'd propose something like the
> following two macros to make it easier:
>
> (ert-resource-directory)
> (ert-resource-file NAME)
>
> Please see the attached patch, the second of which uses the macros in
> our test suite.  Not sure if they should be in ert.el, so I put them in
> ert-x.el for now to play it safe.
>
> Any comments?

Nice idea. Have you tested, that it also works for GNU ELPA packages?
And no, pls change the tests in GNU ELPA yet, unless they require Emacs 28.

I miss a patch for dbus-tests.el.

For Tramp, I would need to adapt your change due to backward
compatibility. But don't worry, your patch could go as it is into master before.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43792; Package emacs. (Mon, 05 Oct 2020 07:31:01 GMT) Full text and rfc822 format available.

Message #11 received at 43792 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 43792 <at> debbugs.gnu.org
Subject: Re: bug#43792: [PATCH] Add ert macros to get resource file names
Date: Mon, 05 Oct 2020 09:30:03 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> There's a lot of repetitive code to get at the resource directories for
> tests.  That's obviously boring, so I'd propose something like the
> following two macros to make it easier:
>
> (ert-resource-directory)
> (ert-resource-file NAME)
>
> Please see the attached patch, the second of which uses the macros in
> our test suite.  Not sure if they should be in ert.el, so I put them in
> ert-x.el for now to play it safe.

Looks good to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43792; Package emacs. (Fri, 16 Oct 2020 09:48:01 GMT) Full text and rfc822 format available.

Message #14 received at 43792 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 43792 <at> debbugs.gnu.org
Subject: Re: bug#43792: [PATCH] Add ert macros to get resource file names
Date: Fri, 16 Oct 2020 02:47:36 -0700
Hi Michael,

Michael Albinus <michael.albinus <at> gmx.de> writes:

>> (ert-resource-directory)
>> (ert-resource-file NAME)
>
> Nice idea. Have you tested, that it also works for GNU ELPA packages?

Yes, it seems to work in my testing.  But if anyone wants to give it
more testing, that can only help.

> I miss a patch for dbus-tests.el.

Right, I missed that.  I'll add it before pushing.

> For Tramp, I would need to adapt your change due to backward
> compatibility. But don't worry, your patch could go as it is into
> master before.

OK, thanks!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43792; Package emacs. (Fri, 16 Oct 2020 09:48:02 GMT) Full text and rfc822 format available.

Message #17 received at 43792 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 43792 <at> debbugs.gnu.org
Subject: Re: bug#43792: [PATCH] Add ert macros to get resource file names
Date: Fri, 16 Oct 2020 02:47:45 -0700
close 43792 28.1
thanks

Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> There's a lot of repetitive code to get at the resource directories for
>> tests.  That's obviously boring, so I'd propose something like the
>> following two macros to make it easier:
>>
>> (ert-resource-directory)
>> (ert-resource-file NAME)
>>
>> Please see the attached patch, the second of which uses the macros in
>> our test suite.  Not sure if they should be in ert.el, so I put them in
>> ert-x.el for now to play it safe.
>
> Looks good to me.

Thanks for reviewing; pushed to master as commit f52a775ae2 and
1f44a77672.




bug marked as fixed in version 28.1, send any further explanations to 43792 <at> debbugs.gnu.org and Stefan Kangas <stefan <at> marxist.se> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 16 Oct 2020 09:48:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Nov 2020 12:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 217 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.