emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tests in core depending on GNU ELPA packages


From: Thomas Fitzsimmons
Subject: Re: Tests in core depending on GNU ELPA packages
Date: Thu, 18 Feb 2021 20:09:18 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (gnu/linux)

Hi Stefan,

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> Also, the proposed bundling doesn't let Emacs's own code depend on GNU
>>> ELPA code, so it still wouldn't allow us to use `dash.el` inside Emacs.
>>>
>>> I don't see any need to "solve" or discuss those issues before we can
>>> bundle packages.
>>
>> Nice work reorganizing GNU ELPA.
>>
>> As part of my work on bug#43566, I'd like to add a test to
>> test/lisp/net/ntlm-tests.el that depends on the GNU ELPA packages
>> ws-server and url-http-ntlm.  I'd prefer the test to be in core rather
>> than GNU ELPA, since it's specifically to prevent ntlm.el regressions
>> introduced by core changes (e.g., url).
>>
>> Can you suggest a way to accomplish this?
>
> You could add the tests and mark them (skip-unless (fboundp '...)).
> This means they won't be tested in the "normal" regression tests where
> those extra packages aren't installed, but at least anyone could run them
> by installing the corresponding packages.

OK, that approach works.  For loading the files, how about the attached?
It doesn't change the "make check" results on master tip, and I
confirmed that my new NTLM tests are properly skipped (via skip-unless)
when anything goes wrong locating the GNU ELPA dependencies.

Thanks,
Thomas

diff --git a/test/Makefile.in b/test/Makefile.in
index f907602a62..ff228d1261 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -71,6 +71,15 @@ am__v_at_0 =
 am__v_at_1 =
 
 
+# Load any GNU ELPA dependencies that are present, for optional tests.
+GNU_ELPA_DIRECTORY ?= $(srcdir)/../../elpa
+# Keep elpa_dependencies dependency-ordered.
+elpa_dependencies = \
+       url-http-ntlm/url-http-ntlm.el \
+       web-server/web-server.el
+elpa_els = $(addprefix $(GNU_ELPA_DIRECTORY)/packages/,$(elpa_dependencies))
+elpa_opts = $(foreach el,$(elpa_els),$(and $(wildcard $(el)),-L $(dir $(el)) 
-l $(el)))
+
 # We never change directory before running Emacs, so a relative file
 # name is fine, and makes life easier.  If we need to change
 # directory, we can use emacs --chdir.
@@ -81,7 +90,7 @@ EMACS_EXTRAOPT=
 # Command line flags for Emacs.
 # Apparently MSYS bash would convert "-L :" to "-L ;" anyway,
 # but we might as well be explicit.
-EMACSOPT = --no-init-file --no-site-file --no-site-lisp -L 
"$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT)
+EMACSOPT = --no-init-file --no-site-file --no-site-lisp -L 
"$(SEPCHAR)$(srcdir)" $(elpa_opts) $(EMACS_EXTRAOPT)
 
 # Prevent any settings in the user environment causing problems.
 unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
@@ -105,7 +114,7 @@ TEST_RUN_ERT =
     $(if $(findstring $(MAKECMDGOALS), all check check-maybe),no,yes)
 
 # Additional settings for ert.
-ert_opts =
+ert_opts += $(elpa_opts)
 
 # Maximum length of lines in ert backtraces; nil for no limit.
 # (if empty, use the default ert-batch-backtrace-right-margin).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]