From: Glenn Morris Date: Sat, 28 Jun 2014 17:05:00 +0000 (-0700) Subject: Disable logging in the short form of the test Makefile rules X-Git-Tag: emacs-25.0.90~2636^2~74^2~23 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8eb6542f53f7fe9b682d11b15dd0346722db0ce3;p=emacs.git 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. --- diff --git a/test/ChangeLog b/test/ChangeLog index f67fad959fa..fca8c2bb1d7 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,5 +1,9 @@ 2014-06-28 Glenn Morris + * 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 da14fda88d6..b769ead7bc9 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})))