summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/Makefile.in6
-rw-r--r--lwlib/Makefile.in2
-rw-r--r--src/Makefile.in5
-rw-r--r--test/Makefile.in37
-rw-r--r--test/README11
5 files changed, 46 insertions, 15 deletions
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 19b01802268..ccc5323b524 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -263,9 +263,9 @@ ${ETAGS}: FORCE
## compile-main. But maybe this is not even necessary any more now
## that this uses relative filenames.
TAGS: ${ETAGS} ${tagsfiles}
- rm -f $@
- touch $@
- ls ${tagsfiles} | xargs $(XARGS_LIMIT) "${ETAGS}" -a -o $@
+ $(AM_V_at)rm -f $@
+ $(AM_V_at)touch $@
+ $(AM_V_GEN)ls ${tagsfiles} | xargs $(XARGS_LIMIT) "${ETAGS}" -a -o $@
# The src/Makefile.in has its own set of dependencies and when they decide
diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in
index 32d7a91f9b0..6bd26083816 100644
--- a/lwlib/Makefile.in
+++ b/lwlib/Makefile.in
@@ -131,6 +131,6 @@ FORCE:
.PHONY: tags FORCE
tags: TAGS
TAGS: ${ETAGS} $(ctagsfiles)
- ${ETAGS} $(ctagsfiles)
+ $(AM_V_GEN)${ETAGS} $(ctagsfiles)
### Makefile.in ends here
diff --git a/src/Makefile.in b/src/Makefile.in
index 7bbe4e199ef..c3bcc503492 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -682,13 +682,14 @@ ${ETAGS}: FORCE
ctagsfiles1 = $(wildcard ${srcdir}/*.[hc])
ctagsfiles2 = $(wildcard ${srcdir}/*.m)
-## FIXME? In out-of-tree builds, should TAGS be generated in srcdir?
+## In out-of-tree builds, TAGS are generated in the build dir, like
+## other non-bootstrap build products (see Bug#31744).
## This does not need to depend on ../lisp and ../lwlib TAGS files,
## because etags "--include" only includes a pointer to the file,
## rather than the file contents.
TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2)
- ${ETAGS} --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \
+ $(AM_V_GEN)${ETAGS} --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \
--regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/\1/' \
--regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"[^"]+",[ ]\([A-Za-z0-9_]+\)/\1/' \
$(ctagsfiles1) \
diff --git a/test/Makefile.in b/test/Makefile.in
index bf1f9f39b71..0bc893bc0c6 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -81,7 +81,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 = -batch --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT)
+EMACSOPT = --no-init-file --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT)
# Prevent any settings in the user environment causing problems.
unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
@@ -94,6 +94,15 @@ GDB =
# supported everywhere.
TEST_LOCALE = C
+# Set this to 'yes' to run the tests in an interactive instance.
+TEST_INTERACTIVE ?= no
+
+ifeq ($(TEST_INTERACTIVE),yes)
+TEST_RUN_ERT = --eval '(ert (quote ${SELECTOR_ACTUAL}))'
+else
+TEST_RUN_ERT = --batch --eval '(ert-run-tests-batch-and-exit (quote ${SELECTOR_ACTUAL}))' ${WRITE_LOG}
+endif
+
# Whether to run tests from .el files in preference to .elc, we do
# this by default since it gives nicer stacktraces.
# If you just want a pass/fail, setting this to no is much faster.
@@ -123,15 +132,20 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \
EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \
$(GDB) "$(EMACS)" $(MODULES_EMACSOPT) $(EMACSOPT)
+# Set HOME to a nonexistent directory to prevent tests from accessing
+# it accidentally (e.g., popping up a gnupg dialog if ~/.authinfo.gpg
+# exists, or writing to ~/.bzr.log when running bzr commands).
+TEST_HOME = /nonexistent
+
test_module_dir := data/emacs-module
.PHONY: all check
all: check
-SELECTOR_DEFAULT = (quote (not (or (tag :expensive-test) (tag :unstable))))
-SELECTOR_EXPENSIVE = (quote (not (tag :unstable)))
-SELECTOR_ALL = nil
+SELECTOR_DEFAULT = (not (or (tag :expensive-test) (tag :unstable)))
+SELECTOR_EXPENSIVE = (not (tag :unstable))
+SELECTOR_ALL = t
ifdef SELECTOR
SELECTOR_ACTUAL=$(SELECTOR)
else ifndef MAKECMDGOALS
@@ -148,7 +162,7 @@ endif
## Byte-compile all test files to test for errors.
%.elc: %.el
- $(AM_V_ELC)$(emacs) -f batch-byte-compile $<
+ $(AM_V_ELC)$(emacs) --batch -f batch-byte-compile $<
## Save logs, and show logs for failed tests.
WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
@@ -166,9 +180,9 @@ endif
%.log: %.elc
$(AM_V_at)${MKDIR_P} $(dir $@)
- $(AM_V_GEN)HOME=/nonexistent $(emacs) \
+ $(AM_V_GEN)HOME=$(TEST_HOME) $(emacs) \
-l ert ${ert_opts} -l $(testloadfile) \
- --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG}
+ $(TEST_RUN_ERT)
ifeq (@HAVE_MODULES@, yes)
maybe_exclude_module_tests :=
@@ -276,9 +290,16 @@ check-maybe: check-no-automated-subdir
## We can't put LOGFILES as prerequisites, because that would stop the
## summarizing step from running when there is an error.
check-doit:
+ifeq ($(TEST_INTERACTIVE), yes)
+ HOME=$(TEST_HOME) $(emacs) \
+ -l ert ${ert_opts} \
+ $(patsubst %,-l %,$(if $(findstring $(TEST_LOAD_EL),yes),$ELFILES,$(ELFILES:.el=))) \
+ $(TEST_RUN_ERT)
+else
-@${MAKE} -k ${LOGFILES}
- @$(emacs) -l ert --eval \
+ @$(emacs) --batch -l ert --eval \
"(ert-summarize-tests-batch-and-exit ${SUMMARIZE_TESTS})" ${LOGFILES}
+endif
.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
diff --git a/test/README b/test/README
index 1bfa9037ea6..83ee2614004 100644
--- a/test/README
+++ b/test/README
@@ -56,7 +56,10 @@ except the tests tagged as expensive or unstable.
If your test file contains the tests "test-foo", "test2-foo" and
"test-foo-remote", and you want to run only the former two tests, you
-could use a selector regexp: "make <filename> SELECTOR='\"foo$$\"'".
+could use a selector regexp (note that the "$" needs to be doubled to
+protect against "make" variable expansion):
+
+ make <filename> SELECTOR='"foo$$"'
Note that although the test files are always compiled (unless they set
no-byte-compile), the source files will be run when expensive or
@@ -70,6 +73,12 @@ Some tests might take long time to run. In order to summarize the
make SUMMARIZE_TESTS=<nn> ...
+The tests are run in batch mode by default; sometimes it's useful to
+get precisely the same environment but run in interactive mode for
+debugging. To do that, use
+
+ make TEST_INTERACTIVE=yes ...
+
(Also, see etc/compilation.txt for compilation mode font lock tests.)