]> code.delx.au - gnu-emacs/commitdiff
Merge from origin/emacs-25
authorJohn Wiegley <johnw@newartisans.com>
Fri, 4 Mar 2016 07:53:27 +0000 (23:53 -0800)
committerJohn Wiegley <johnw@newartisans.com>
Fri, 4 Mar 2016 07:53:27 +0000 (23:53 -0800)
f5d1435 Fix targets in test/automated/Makefile.in

1  2 
test/Makefile.in

diff --combined test/Makefile.in
index a5755fd225937e8b3ddd0d371dc9e541b170e236,9c9b3be1e0b3de74d0821ead129cf0a2bed9a2ce..26d7e591c7a2b23b77fa5064418d3c4512a6d47a
@@@ -21,8 -21,7 +21,8 @@@
  
  ## Some targets:
  ## check: re-run all tests, writing to .log files.
 -## check-maybe: run all tests whose .log file needs updating
 +## check-maybe: run all tests which are outdated with their .log file
 +## or the source files they are testing.
  ## filename.log: run tests from filename.el(c) if .log file needs updating
  ## filename: re-run tests from filename.el(c), with no logging
  
@@@ -33,14 -32,12 +33,14 @@@ SHELL = @SHELL
  srcdir = @srcdir@
  VPATH = $(srcdir)
  
 +MKDIR_P = @MKDIR_P@
 +
  SEPCHAR = @SEPCHAR@
  
  # 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.
 -EMACS = ../../src/emacs
 +EMACS = ../src/emacs
  
  EMACS_EXTRAOPT=
  
@@@ -94,6 -91,10 +94,10 @@@ SELECTOR_DEFAULT = (quote (not (tag :ex
  SELECTOR_EXPENSIVE = nil
  ifdef SELECTOR
  SELECTOR_ACTUAL=$(SELECTOR)
+ else ifndef MAKECMDGOALS
+ SELECTOR_ACTUAL=$(SELECTOR_DEFAULT)
+ else ifeq ($(MAKECMDGOALS),all)
+ SELECTOR_ACTUAL=$(SELECTOR_DEFAULT)
  else ifeq ($(MAKECMDGOALS),check)
  SELECTOR_ACTUAL=$(SELECTOR_DEFAULT)
  else ifeq ($(MAKECMDGOALS),check-maybe)
@@@ -103,7 -104,7 +107,7 @@@ SELECTOR_ACTUAL=$(SELECTOR_EXPENSIVE
  endif
  
  
 -%.log: ${srcdir}/%.el
 +%.log: %.el
        @if grep '^;.*no-byte-compile: t' $< > /dev/null; then \
          loadfile=$<; \
        else \
        fi; \
        echo Testing $$loadfile; \
        stat=OK ; \
 +      ${MKDIR_P} $(dir $@) ; \
        $(emacs) -l ert -l $$loadfile \
          --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG}
  
 -ELFILES = $(sort $(wildcard ${srcdir}/*.el))
 -LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES}))
 -TESTS = ${LOGFILES:.log=}
 +ELFILES = $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \
 +              -path "*resources" -prune -o -name "*el" -print)
 +## .elc files may be in a different directory for out of source builds
 +ELCFILES = $(patsubst %.el,%.elc, \
 +              $(patsubst $(srcdir)%,.%,$(ELFILES)))
 +LOGFILES = $(patsubst %.elc,%.log,${ELCFILES})
 +LOGSAVEFILES  = $(patsubst %.elc,%.log~,${ELCFILES})
 +TESTS = $(subst ${srcdir}/,,$(LOGFILES:.log=))
  
  ## If we have to interrupt a hanging test, preserve the log so we can
  ## see what the problem was.
  .PHONY: ${TESTS}
  
  ## The short aliases that always re-run the tests, with no logging.
 +## Define an alias both with and without the directory name for ease
 +## of use.
  define test_template
  $(1):
 -      @test ! -f $(1).log || mv $(1).log $(1).log~
 -      @${MAKE} $(1).log WRITE_LOG=
 +      @test ! -f ./$(1).log || mv ./$(1).log ./$(1).log~
 +      @${MAKE} ./$(1).log WRITE_LOG=
 +
 +$(notdir $(1)): $(1)
  endef
  
  $(foreach test,${TESTS},$(eval $(call test_template,${test})))
  
 +## Include dependencies between test files and the files they test.
 +## We could do this without the file and eval directly, but then we
 +## would have to run Emacs for every make invocation, and it might not
 +## be available during clean.
 +-include make-test-deps.mk
  ## Rerun all default tests.
  check: mostlyclean
        @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}"
  check-expensive: mostlyclean
        @${MAKE} check-doit SELECTOR="${SELECTOR_EXPENSIVE}"
  
 -## Only re-run default tests whose .log is older than the test.
 +## Re-run all tests which are outdated. A test is outdated if its
 +## logfile is out-of-date with either the test file, or the source
 +## files that the tests depend on. The source file dependencies are
 +## determined by a heuristic and does not identify the full dependency
 +## graph. See make-test-deps.emacs-lisp for details.
  .PHONY: check-maybe
  check-maybe:
        @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}"
@@@ -175,22 -157,17 +179,22 @@@ check-doit: ${LOGFILES
  .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
  
  mostlyclean:
 -      -@for f in *.log; do test ! -f $$f || mv $$f $$f~; done
 +      -@for f in ${LOGFILES}; do test ! -f $$f || mv $$f $$f~; done
  
  clean:
 -      -rm -f *.log *.log~
 +      -rm -f ${LOGFILES} ${LOGSAVEFILES}
 +      -rm make-test-deps.mk
  
  bootstrap-clean: clean
 -      -rm -f ${srcdir}/*.elc
 +      -rm -f ${ELCFILES}
  
  distclean: clean
        rm -f Makefile
  
  maintainer-clean: distclean bootstrap-clean
  
 +make-test-deps.mk: $(ELFILES) make-test-deps.emacs-lisp
 +      $(EMACS) --batch -l $(srcdir)/make-test-deps.emacs-lisp \
 +      --eval "(make-test-deps \"$(srcdir)\")" \
 +      2> $@
  # Makefile ends here.