]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge from origin/emacs-26
authorGlenn Morris <rgm@gnu.org>
Mon, 18 Jun 2018 19:14:24 +0000 (12:14 -0700)
committerGlenn Morris <rgm@gnu.org>
Mon, 18 Jun 2018 19:14:24 +0000 (12:14 -0700)
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

1  2 
lisp/Makefile.in
src/Makefile.in
test/Makefile.in
test/README

Simple merge
diff --cc src/Makefile.in
Simple merge
index bf1f9f39b710a4300be6796c13df7c604ed43b4a,597ef9131134d8bc320d1107208ac5620af8e8fe..0bc893bc0c69b3f5c9194c734c589096d7db3d62
@@@ -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)
  
 -test_module_dir := $(srcdir)/data/emacs-module
+ # 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
  
@@@ -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 1bfa9037ea6b7dfd5bc77584ed70f5cc994bc64f,e473248c9e0c7f89e55626433ebc0cb2970a2ea4..83ee2614004d9b9f68216cf29528df2484401743
@@@ -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 <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 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
 +<nn> tests with the longest duration, call
 +
 +    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 ...
  \f
  (Also, see etc/compilation.txt for compilation mode font lock tests.)