aboutsummaryrefslogtreecommitdiffstats
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
263## compile-main. But maybe this is not even necessary any more now 263## compile-main. But maybe this is not even necessary any more now
264## that this uses relative filenames. 264## that this uses relative filenames.
265TAGS: ${ETAGS} ${tagsfiles} 265TAGS: ${ETAGS} ${tagsfiles}
266 rm -f $@ 266 $(AM_V_at)rm -f $@
267 touch $@ 267 $(AM_V_at)touch $@
268 ls ${tagsfiles} | xargs $(XARGS_LIMIT) "${ETAGS}" -a -o $@ 268 $(AM_V_GEN)ls ${tagsfiles} | xargs $(XARGS_LIMIT) "${ETAGS}" -a -o $@
269 269
270 270
271# The src/Makefile.in has its own set of dependencies and when they decide 271# 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:
131.PHONY: tags FORCE 131.PHONY: tags FORCE
132tags: TAGS 132tags: TAGS
133TAGS: ${ETAGS} $(ctagsfiles) 133TAGS: ${ETAGS} $(ctagsfiles)
134 ${ETAGS} $(ctagsfiles) 134 $(AM_V_GEN)${ETAGS} $(ctagsfiles)
135 135
136### Makefile.in ends here 136### 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
682ctagsfiles1 = $(wildcard ${srcdir}/*.[hc]) 682ctagsfiles1 = $(wildcard ${srcdir}/*.[hc])
683ctagsfiles2 = $(wildcard ${srcdir}/*.m) 683ctagsfiles2 = $(wildcard ${srcdir}/*.m)
684 684
685## FIXME? In out-of-tree builds, should TAGS be generated in srcdir? 685## In out-of-tree builds, TAGS are generated in the build dir, like
686## other non-bootstrap build products (see Bug#31744).
686 687
687## This does not need to depend on ../lisp and ../lwlib TAGS files, 688## This does not need to depend on ../lisp and ../lwlib TAGS files,
688## because etags "--include" only includes a pointer to the file, 689## because etags "--include" only includes a pointer to the file,
689## rather than the file contents. 690## rather than the file contents.
690TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2) 691TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2)
691 ${ETAGS} --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \ 692 $(AM_V_GEN)${ETAGS} --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \
692 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/\1/' \ 693 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/\1/' \
693 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"[^"]+",[ ]\([A-Za-z0-9_]+\)/\1/' \ 694 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"[^"]+",[ ]\([A-Za-z0-9_]+\)/\1/' \
694 $(ctagsfiles1) \ 695 $(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=
81# Command line flags for Emacs. 81# Command line flags for Emacs.
82# Apparently MSYS bash would convert "-L :" to "-L ;" anyway, 82# Apparently MSYS bash would convert "-L :" to "-L ;" anyway,
83# but we might as well be explicit. 83# but we might as well be explicit.
84EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT) 84EMACSOPT = --no-init-file --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT)
85 85
86# Prevent any settings in the user environment causing problems. 86# Prevent any settings in the user environment causing problems.
87unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS 87unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
@@ -94,6 +94,15 @@ GDB =
94# supported everywhere. 94# supported everywhere.
95TEST_LOCALE = C 95TEST_LOCALE = C
96 96
97# Set this to 'yes' to run the tests in an interactive instance.
98TEST_INTERACTIVE ?= no
99
100ifeq ($(TEST_INTERACTIVE),yes)
101TEST_RUN_ERT = --eval '(ert (quote ${SELECTOR_ACTUAL}))'
102else
103TEST_RUN_ERT = --batch --eval '(ert-run-tests-batch-and-exit (quote ${SELECTOR_ACTUAL}))' ${WRITE_LOG}
104endif
105
97# Whether to run tests from .el files in preference to .elc, we do 106# Whether to run tests from .el files in preference to .elc, we do
98# this by default since it gives nicer stacktraces. 107# this by default since it gives nicer stacktraces.
99# If you just want a pass/fail, setting this to no is much faster. 108# If you just want a pass/fail, setting this to no is much faster.
@@ -123,15 +132,20 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \
123 EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \ 132 EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \
124 $(GDB) "$(EMACS)" $(MODULES_EMACSOPT) $(EMACSOPT) 133 $(GDB) "$(EMACS)" $(MODULES_EMACSOPT) $(EMACSOPT)
125 134
135# Set HOME to a nonexistent directory to prevent tests from accessing
136# it accidentally (e.g., popping up a gnupg dialog if ~/.authinfo.gpg
137# exists, or writing to ~/.bzr.log when running bzr commands).
138TEST_HOME = /nonexistent
139
126test_module_dir := data/emacs-module 140test_module_dir := data/emacs-module
127 141
128.PHONY: all check 142.PHONY: all check
129 143
130all: check 144all: check
131 145
132SELECTOR_DEFAULT = (quote (not (or (tag :expensive-test) (tag :unstable)))) 146SELECTOR_DEFAULT = (not (or (tag :expensive-test) (tag :unstable)))
133SELECTOR_EXPENSIVE = (quote (not (tag :unstable))) 147SELECTOR_EXPENSIVE = (not (tag :unstable))
134SELECTOR_ALL = nil 148SELECTOR_ALL = t
135ifdef SELECTOR 149ifdef SELECTOR
136SELECTOR_ACTUAL=$(SELECTOR) 150SELECTOR_ACTUAL=$(SELECTOR)
137else ifndef MAKECMDGOALS 151else ifndef MAKECMDGOALS
@@ -148,7 +162,7 @@ endif
148 162
149## Byte-compile all test files to test for errors. 163## Byte-compile all test files to test for errors.
150%.elc: %.el 164%.elc: %.el
151 $(AM_V_ELC)$(emacs) -f batch-byte-compile $< 165 $(AM_V_ELC)$(emacs) --batch -f batch-byte-compile $<
152 166
153## Save logs, and show logs for failed tests. 167## Save logs, and show logs for failed tests.
154WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; } 168WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
@@ -166,9 +180,9 @@ endif
166 180
167%.log: %.elc 181%.log: %.elc
168 $(AM_V_at)${MKDIR_P} $(dir $@) 182 $(AM_V_at)${MKDIR_P} $(dir $@)
169 $(AM_V_GEN)HOME=/nonexistent $(emacs) \ 183 $(AM_V_GEN)HOME=$(TEST_HOME) $(emacs) \
170 -l ert ${ert_opts} -l $(testloadfile) \ 184 -l ert ${ert_opts} -l $(testloadfile) \
171 --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG} 185 $(TEST_RUN_ERT)
172 186
173ifeq (@HAVE_MODULES@, yes) 187ifeq (@HAVE_MODULES@, yes)
174maybe_exclude_module_tests := 188maybe_exclude_module_tests :=
@@ -276,9 +290,16 @@ check-maybe: check-no-automated-subdir
276## We can't put LOGFILES as prerequisites, because that would stop the 290## We can't put LOGFILES as prerequisites, because that would stop the
277## summarizing step from running when there is an error. 291## summarizing step from running when there is an error.
278check-doit: 292check-doit:
293ifeq ($(TEST_INTERACTIVE), yes)
294 HOME=$(TEST_HOME) $(emacs) \
295 -l ert ${ert_opts} \
296 $(patsubst %,-l %,$(if $(findstring $(TEST_LOAD_EL),yes),$ELFILES,$(ELFILES:.el=))) \
297 $(TEST_RUN_ERT)
298else
279 -@${MAKE} -k ${LOGFILES} 299 -@${MAKE} -k ${LOGFILES}
280 @$(emacs) -l ert --eval \ 300 @$(emacs) --batch -l ert --eval \
281 "(ert-summarize-tests-batch-and-exit ${SUMMARIZE_TESTS})" ${LOGFILES} 301 "(ert-summarize-tests-batch-and-exit ${SUMMARIZE_TESTS})" ${LOGFILES}
302endif
282 303
283.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean 304.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
284 305
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.
56 56
57If your test file contains the tests "test-foo", "test2-foo" and 57If your test file contains the tests "test-foo", "test2-foo" and
58"test-foo-remote", and you want to run only the former two tests, you 58"test-foo-remote", and you want to run only the former two tests, you
59could use a selector regexp: "make <filename> SELECTOR='\"foo$$\"'". 59could use a selector regexp (note that the "$" needs to be doubled to
60protect against "make" variable expansion):
61
62 make <filename> SELECTOR='"foo$$"'
60 63
61Note that although the test files are always compiled (unless they set 64Note that although the test files are always compiled (unless they set
62no-byte-compile), the source files will be run when expensive or 65no-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
70 73
71 make SUMMARIZE_TESTS=<nn> ... 74 make SUMMARIZE_TESTS=<nn> ...
72 75
76The tests are run in batch mode by default; sometimes it's useful to
77get precisely the same environment but run in interactive mode for
78debugging. To do that, use
79
80 make TEST_INTERACTIVE=yes ...
81
73 82
74(Also, see etc/compilation.txt for compilation mode font lock tests.) 83(Also, see etc/compilation.txt for compilation mode font lock tests.)
75 84