From: Glenn Morris Date: Mon, 18 Jun 2018 19:14:24 +0000 (-0700) Subject: Merge from origin/emacs-26 X-Git-Tag: emacs-27.0.90~4807 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef02c9fd1a6bdafebc2bba58a551ec11e29bd394;p=emacs.git Merge from origin/emacs-26 5bdc344 ; Reduce quoting for SELECTOR in 'make -C test' (Bug#31744) b6b793b ; test/Makefile.in: Add TEST_INTERACTIVE option (Bug#31744). 1aa906f Make 'tags' targets respect --with-silent-rules (Bug#31744) Conflicts: test/Makefile.in test/README --- ef02c9fd1a6bdafebc2bba58a551ec11e29bd394 diff --cc test/Makefile.in index bf1f9f39b71,597ef913113..0bc893bc0c6 --- a/test/Makefile.in +++ b/test/Makefile.in @@@ -94,14 -94,18 +94,23 @@@ 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. -TEST_LOAD_EL ?= yes +# If you just want a pass/fail, setting this to no is much faster. +export TEST_LOAD_EL ?= \ + $(if $(findstring $(MAKECMDGOALS), all check check-maybe),no,yes) + +# Additional settings for ert. +ert_opts = # Maximum length of lines in ert backtraces; nil for no limit. # (if empty, use the default ert-batch-backtrace-right-margin). @@@ -123,7 -129,12 +132,12 @@@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LO 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 := $(srcdir)/data/emacs-module +test_module_dir := data/emacs-module .PHONY: all check @@@ -276,9 -274,15 +290,16 @@@ check-maybe: check-no-automated-subdi ## 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 -f ert-summarize-tests-batch-and-exit ${LOGFILES} ++ @$(emacs) --batch -l ert --eval \ + "(ert-summarize-tests-batch-and-exit ${SUMMARIZE_TESTS})" ${LOGFILES} + endif .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean diff --cc test/README index 1bfa9037ea6,e473248c9e0..83ee2614004 --- a/test/README +++ b/test/README @@@ -56,20 -42,23 +56,29 @@@ except the tests tagged as expensive o 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 SELECTOR='\"foo$$\"'". + could use a selector regexp (note that the "$" needs to be doubled to + protect against "make" variable expansion): + + make SELECTOR='"foo$$"' Note that although the test files are always compiled (unless they set -no-byte-compile), the source files will be run by default, to give -nicer backtraces. To run the compiled version of a test use +no-byte-compile), the source files will be run when expensive or +unstable tests are involved, to give nicer backtraces. To run the +compiled version of a test use make TEST_LOAD_EL=no ... +Some tests might take long time to run. In order to summarize the + tests with the longest duration, call + + make SUMMARIZE_TESTS= ... + + 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.)