* src/fns.c (Fcompare_strings): Use FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE.
[bpt/emacs.git] / test / automated / Makefile.in
CommitLineData
bbece175
GM
1### @configure_input@
2
ba318903 3# Copyright (C) 2010-2014 Free Software Foundation, Inc.
d221e780
CO
4
5# This file is part of GNU Emacs.
6
7# GNU Emacs is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11
12# GNU Emacs is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16
17# You should have received a copy of the GNU General Public License
18# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
50b13cde 20SHELL = @SHELL@
d221e780
CO
21
22srcdir = @srcdir@
d221e780 23VPATH = $(srcdir)
d221e780 24
0845be75 25SEPCHAR = @SEPCHAR@
2df10228 26
67fb4e6a
GM
27# We never change directory before running Emacs, so a relative file
28# name is fine, and makes life easier. If we need to change
29# directory, we can use emacs --chdir.
30EMACS = ../../src/emacs
d221e780
CO
31
32# Command line flags for Emacs.
2df10228
GM
33# Apparently MSYS bash would convert "-L :" to "-L ;" anyway,
34# but we might as well be explicit.
0845be75 35EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)"
d221e780 36
e088b01d 37# Prevent any settings in the user environment causing problems.
5a8816f3 38unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
e088b01d 39
d221e780 40# The actual Emacs command run in the targets below.
8b77446f 41# Prevent any setting of EMACSLOADPATH in user environment causing problems.
17e0445b 42emacs = EMACSLOADPATH= LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
d221e780 43
67bb589e 44.PHONY: all check
d221e780 45
67bb589e 46all: check
d221e780 47
5a8816f3 48%.elc: %.el
d221e780 49 @echo Compiling $<
5a8816f3
GM
50 @$(emacs) -f batch-byte-compile $<
51
52## Ignore any test errors so we can continue to test other files.
53## (It would be nice if we could get an error when running an
54## individual test, but not when running check.)
55## But compilation errors are always fatal.
56##
57## I'd prefer to use -emacs -f ert-run-tests-batch-and-exit rather
58## than || true, since the former makes problems more obvious.
59## I'd also prefer to @-hide the grep part and not the
60## ert-run-tests-batch-and-exit part.
61##
62## We need to use $loadfile because:
63## i) -L :$srcdir -l basename does not work, because we have files whose
64## basename duplicates a file in lisp/ (eg eshell.el).
65## ii) Although -l basename will automatically load .el or .elc,
66## -l ./basename treats basename as a literal file (it would be nice
67## to change this).
68##
69## Beware: it approximates `no-byte-compile', so watch out for false-positives!
70%.log: ${srcdir}/%.el
71 @if grep '^;.*no-byte-compile: t' $< > /dev/null; then \
72 loadfile=$<; \
73 else \
74 loadfile=$<c; \
75 ${MAKE} $$loadfile; \
76 fi; \
77 echo Testing $$loadfile; \
78 stat=OK ; \
79 $(emacs) -l ert -l $$loadfile \
80 -f ert-run-tests-batch-and-exit >& $@ || stat=ERROR; \
81 echo $$stat: $@
82
83ELFILES = $(wildcard ${srcdir}/*.el)
84LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES}))
85
86## If we have to interrupt a hanging test, preserve the log so we can
87## see what the problem was.
88.PRECIOUS: %.log
89
90check: ${LOGFILES}
91 $(emacs) -l ert -f ert-summarize-tests-batch-and-exit $^
92
93.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
94
95clean mostlyclean:
96 -rm -f *.log
97
98bootstrap-clean: clean
99 -rm -f ${srcdir}/*.elc
100
101distclean: clean
1f43ed41 102 rm -f Makefile
d221e780
CO
103
104maintainer-clean: distclean bootstrap-clean
105
d221e780 106# Makefile ends here.