aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-05-30 23:31:18 -0400
committerNoam Postavsky2017-05-31 07:43:54 -0400
commit94306c8b0d61a53b19dcee18475ea8692b001f5d (patch)
tree33b806f50e88a57098139209f6113af4bf94c435
parent7b4a0e2884004f44f3bdebecbcdfb6b6dcf99fdd (diff)
downloademacs-94306c8b0d61a53b19dcee18475ea8692b001f5d.tar.gz
emacs-94306c8b0d61a53b19dcee18475ea8692b001f5d.zip
Further simplify test/Makefile, optionally load elc tests
* test/Makefile.in: Use make's error ignoring feature instead of suppressing test errors with shell. Compile test files in the main make invocation instead of a recursive 'make' call. Optionally load .elc test files if TEST_LOAD_EL is set to something other than 'yes'. Remove obsolete commentary.
-rw-r--r--test/Makefile.in47
1 files changed, 19 insertions, 28 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 8880ee21936..0d1663a4cdd 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -81,6 +81,10 @@ GDB =
81# supported everywhere. 81# supported everywhere.
82TEST_LOCALE = C 82TEST_LOCALE = C
83 83
84# Whether to run tests from .el files in preference to .elc, we do
85# this by default since it gives nicer stacktraces.
86TEST_LOAD_EL ?= yes
87
84# The actual Emacs command run in the targets below. 88# The actual Emacs command run in the targets below.
85# Prevent any setting of EMACSLOADPATH in user environment causing problems. 89# Prevent any setting of EMACSLOADPATH in user environment causing problems.
86emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \ 90emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \
@@ -91,26 +95,6 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \
91 95
92all: check 96all: check
93 97
94%.elc: %.el
95 $(AM_V_ELC)$(emacs) -f batch-byte-compile $<
96
97## Ignore any test errors so we can continue to test other files.
98## But compilation errors are always fatal.
99WRITE_LOG = > $@ 2>&1 || { stat=ERROR; cat $@; }; echo $$stat: $@
100
101## I'd prefer to use -emacs -f ert-run-tests-batch-and-exit rather
102## than || true, since the former makes problems more obvious.
103## I'd also prefer to @-hide the grep part and not the
104## ert-run-tests-batch-and-exit part.
105##
106## We need to use $loadfile because:
107## i) -L :$srcdir -l basename does not work, because we have files whose
108## basename duplicates a file in lisp/ (eg eshell.el).
109## ii) Although -l basename will automatically load .el or .elc,
110## -l ./basename treats basename as a literal file (it would be nice
111## to change this; bug#17848 - if that gets done, this can be simplified).
112##
113## Beware: it approximates 'no-byte-compile', so watch out for false-positives!
114SELECTOR_DEFAULT = (quote (not (tag :expensive-test))) 98SELECTOR_DEFAULT = (quote (not (tag :expensive-test)))
115SELECTOR_EXPENSIVE = nil 99SELECTOR_EXPENSIVE = nil
116ifdef SELECTOR 100ifdef SELECTOR
@@ -127,16 +111,23 @@ else
127SELECTOR_ACTUAL=$(SELECTOR_EXPENSIVE) 111SELECTOR_ACTUAL=$(SELECTOR_EXPENSIVE)
128endif 112endif
129 113
130## Byte-compile all test files to test for errors (unless explicitly 114## Byte-compile all test files to test for errors.
131## told not to), but then evaluate the un-byte-compiled files, because 115%.elc: %.el
132## they give cleaner stacktraces. 116 $(AM_V_ELC)$(emacs) -f batch-byte-compile $<
117
118## Save logs, and show logs for failed tests.
119WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
120
121ifeq ($(TEST_LOAD_EL), yes)
122testloadfile = $*.el
123else
124testloadfile = $*
125endif
133 126
134## Beware: it approximates 'no-byte-compile', so watch out for false-positives! 127## Ignore any test errors so we can continue to test other files.
135%.log: %.el 128%.log: %.elc
136 $(AM_V_at)grep '^;.*no-byte-compile: t' $< > /dev/null || ${MAKE} $<c
137 $(AM_V_at)${MKDIR_P} $(dir $@) 129 $(AM_V_at)${MKDIR_P} $(dir $@)
138 $(AM_V_GEN)stat=OK ; \ 130 -$(AM_V_GEN)HOME=/nonexistent $(emacs) -l ert -l $(testloadfile) \
139 HOME=/nonexistent $(emacs) -l ert -l $< \
140 --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG} 131 --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG}
141 132
142ifeq (@HAVE_MODULES@, yes) 133ifeq (@HAVE_MODULES@, yes)