### @configure_input@
-# Copyright (C) 2010-2014 Free Software Foundation, Inc.
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
# This file is part of GNU Emacs.
# directory, we can use emacs --chdir.
EMACS = ../../src/emacs
+EMACS_EXTRAOPT=
+
# 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)"
+EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT)
# Prevent any settings in the user environment causing problems.
unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
## To run tests under a debugger, set this to eg: "gdb --args".
GDB =
+# The locale to run tests under. Tests should work if this is set to
+# any supported locale. Use the C locale by default, as it should be
+# supported everywhere.
+TEST_LOCALE = C
+
# 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) $(GDB) "$(EMACS)" $(EMACSOPT)
+emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) EMACS_TEST_DIRECTORY=$(srcdir) \
+ $(GDB) "$(EMACS)" $(EMACSOPT)
.PHONY: all check
## Ignore any test errors so we can continue to test other files.
## But compilation errors are always fatal.
-WRITE_LOG = >& $@ || { stat=ERROR; cat $@; }; echo $$stat: $@
+WRITE_LOG = > $@ 2>&1 || { stat=ERROR; cat $@; }; echo $$stat: $@
## I'd prefer to use -emacs -f ert-run-tests-batch-and-exit rather
## than || true, since the former makes problems more obvious.
## -l ./basename treats basename as a literal file (it would be nice
## to change this; bug#17848 - if that gets done, this can be simplified).
##
-## Beware: it approximates `no-byte-compile', so watch out for false-positives!
+## 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=$<; \
$(emacs) -l ert -l $$loadfile \
-f ert-run-tests-batch-and-exit ${WRITE_LOG}
-ELFILES = $(wildcard ${srcdir}/*.el)
+ELFILES = $(sort $(wildcard ${srcdir}/*.el))
LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES}))
TESTS = ${LOGFILES:.log=}