mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-23 18:47:57 +00:00
5a8816f3f2
* Makefile.in (mostlyclean, clean): Maybe clean test/automated. * lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit): New. * test/automated/Makefile.in: Simplify and parallelize. (XARGS_LIMIT, BYTE_COMPILE_EXTRA_FLAGS) (setwins, compile-targets, compile-main, compile-clean): Remove. (GREP_OPTIONS): Unexport. (.el.elc): Replace with pattern rule. (%.elc, %.log): New pattern rules. (ELFILES, LOGFILES): New variables. (check): Depend on LOGFILES. Call ert-summarize-tests-batch-and-exit. (clean, mostlyclean): New rules. (bootstrap-clean): Simplify. (bootstrap-clean, distclean): Depend on clean. * .bzrignore: Ignore test/automated/*.log. Fixes: debbugs:15991
107 lines
3.3 KiB
Makefile
107 lines
3.3 KiB
Makefile
### @configure_input@
|
|
|
|
# Copyright (C) 2010-2014 Free Software Foundation, Inc.
|
|
|
|
# This file is part of GNU Emacs.
|
|
|
|
# GNU Emacs is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
# GNU Emacs is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
SHELL = @SHELL@
|
|
|
|
srcdir = @srcdir@
|
|
VPATH = $(srcdir)
|
|
|
|
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
|
|
|
|
# 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)"
|
|
|
|
# Prevent any settings in the user environment causing problems.
|
|
unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
|
|
|
|
# The actual Emacs command run in the targets below.
|
|
# Prevent any setting of EMACSLOADPATH in user environment causing problems.
|
|
emacs = EMACSLOADPATH= LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
|
|
|
|
.PHONY: all check
|
|
|
|
all: check
|
|
|
|
%.elc: %.el
|
|
@echo Compiling $<
|
|
@$(emacs) -f batch-byte-compile $<
|
|
|
|
## Ignore any test errors so we can continue to test other files.
|
|
## (It would be nice if we could get an error when running an
|
|
## individual test, but not when running check.)
|
|
## But compilation errors are always fatal.
|
|
##
|
|
## I'd prefer to use -emacs -f ert-run-tests-batch-and-exit rather
|
|
## than || true, since the former makes problems more obvious.
|
|
## I'd also prefer to @-hide the grep part and not the
|
|
## ert-run-tests-batch-and-exit part.
|
|
##
|
|
## We need to use $loadfile because:
|
|
## i) -L :$srcdir -l basename does not work, because we have files whose
|
|
## basename duplicates a file in lisp/ (eg eshell.el).
|
|
## ii) Although -l basename will automatically load .el or .elc,
|
|
## -l ./basename treats basename as a literal file (it would be nice
|
|
## to change this).
|
|
##
|
|
## Beware: it approximates `no-byte-compile', so watch out for false-positives!
|
|
%.log: ${srcdir}/%.el
|
|
@if grep '^;.*no-byte-compile: t' $< > /dev/null; then \
|
|
loadfile=$<; \
|
|
else \
|
|
loadfile=$<c; \
|
|
${MAKE} $$loadfile; \
|
|
fi; \
|
|
echo Testing $$loadfile; \
|
|
stat=OK ; \
|
|
$(emacs) -l ert -l $$loadfile \
|
|
-f ert-run-tests-batch-and-exit >& $@ || stat=ERROR; \
|
|
echo $$stat: $@
|
|
|
|
ELFILES = $(wildcard ${srcdir}/*.el)
|
|
LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES}))
|
|
|
|
## If we have to interrupt a hanging test, preserve the log so we can
|
|
## see what the problem was.
|
|
.PRECIOUS: %.log
|
|
|
|
check: ${LOGFILES}
|
|
$(emacs) -l ert -f ert-summarize-tests-batch-and-exit $^
|
|
|
|
.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
|
|
|
|
clean mostlyclean:
|
|
-rm -f *.log
|
|
|
|
bootstrap-clean: clean
|
|
-rm -f ${srcdir}/*.elc
|
|
|
|
distclean: clean
|
|
rm -f Makefile
|
|
|
|
maintainer-clean: distclean bootstrap-clean
|
|
|
|
# Makefile ends here.
|