aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2014-06-28 10:05:00 -0700
committerGlenn Morris <[email protected]>2014-06-28 10:05:00 -0700
commit8eb6542f53f7fe9b682d11b15dd0346722db0ce3 (patch)
tree39d8ab751aa8bd2ac5c472f2920875f155f3dd99 /test
parent7ac67e08e52b7d4c292f17841084f316644ce195 (diff)
Disable logging in the short form of the test Makefile rules
* test/automated/Makefile.in (WRITE_LOG): New variable. (%.log): Use WRITE_LOG. (test_template): Disable logging.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog4
-rw-r--r--test/automated/Makefile.in20
2 files changed, 12 insertions, 12 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index f67fad959f..fca8c2bb1d 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,5 +1,9 @@
2014-06-28 Glenn Morris <[email protected]>
+ * automated/Makefile.in (WRITE_LOG): New variable.
+ (%.log): Use WRITE_LOG.
+ (test_template): Disable logging.
+
* automated/Makefile.in (TESTS): New list of short PHONY aliases.
(test_template): New definition. Apply to TESTS.
diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in
index da14fda88d..b769ead7bc 100644
--- a/test/automated/Makefile.in
+++ b/test/automated/Makefile.in
@@ -20,10 +20,10 @@
### Commentary:
## Some targets:
-## check: re-run all tests
+## check: re-run all tests, writing to .log files.
## check-maybe: run all tests whose .log file needs updating
## filename.log: run tests from filename.el(c) if .log file needs updating
-## filename: re-run tests from filename.el(c)
+## filename: re-run tests from filename.el(c), with no logging
### Code:
@@ -60,10 +60,9 @@ all: check
@$(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.
-##
+WRITE_LOG = >& $@ || { 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.
## I'd also prefer to @-hide the grep part and not the
@@ -74,7 +73,7 @@ all: check
## 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).
+## 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!
%.log: ${srcdir}/%.el
@@ -87,10 +86,7 @@ all: check
echo Testing $$loadfile; \
stat=OK ; \
$(emacs) -l ert -l $$loadfile \
- -f ert-run-tests-batch-and-exit >& $@ || { \
- stat=ERROR; \
- cat $@; }; \
- echo $$stat: $@
+ -f ert-run-tests-batch-and-exit ${WRITE_LOG}
ELFILES = $(wildcard ${srcdir}/*.el)
LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES}))
@@ -102,11 +98,11 @@ TESTS = ${LOGFILES:.log=}
.PHONY: ${TESTS}
-## The short aliases that always re-run the tests.
+## The short aliases that always re-run the tests, with no logging.
define test_template
$(1):
@test ! -f $(1).log || mv $(1).log $(1).log~
- @${MAKE} $(1).log
+ @${MAKE} $(1).log WRITE_LOG=
endef
$(foreach test,${TESTS},$(eval $(call test_template,${test})))