diff options
| author | Glenn Morris | 2014-06-28 10:05:00 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-06-28 10:05:00 -0700 |
| commit | 8eb6542f53f7fe9b682d11b15dd0346722db0ce3 (patch) | |
| tree | 39d8ab751aa8bd2ac5c472f2920875f155f3dd99 | |
| parent | 7ac67e08e52b7d4c292f17841084f316644ce195 (diff) | |
| download | emacs-8eb6542f53f7fe9b682d11b15dd0346722db0ce3.tar.gz emacs-8eb6542f53f7fe9b682d11b15dd0346722db0ce3.zip | |
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.
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/Makefile.in | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index f67fad959fa..fca8c2bb1d7 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2014-06-28 Glenn Morris <rgm@gnu.org> | 1 | 2014-06-28 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * automated/Makefile.in (WRITE_LOG): New variable. | ||
| 4 | (%.log): Use WRITE_LOG. | ||
| 5 | (test_template): Disable logging. | ||
| 6 | |||
| 3 | * automated/Makefile.in (TESTS): New list of short PHONY aliases. | 7 | * automated/Makefile.in (TESTS): New list of short PHONY aliases. |
| 4 | (test_template): New definition. Apply to TESTS. | 8 | (test_template): New definition. Apply to TESTS. |
| 5 | 9 | ||
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 @@ | |||
| 20 | ### Commentary: | 20 | ### Commentary: |
| 21 | 21 | ||
| 22 | ## Some targets: | 22 | ## Some targets: |
| 23 | ## check: re-run all tests | 23 | ## check: re-run all tests, writing to .log files. |
| 24 | ## check-maybe: run all tests whose .log file needs updating | 24 | ## check-maybe: run all tests whose .log file needs updating |
| 25 | ## filename.log: run tests from filename.el(c) if .log file needs updating | 25 | ## filename.log: run tests from filename.el(c) if .log file needs updating |
| 26 | ## filename: re-run tests from filename.el(c) | 26 | ## filename: re-run tests from filename.el(c), with no logging |
| 27 | 27 | ||
| 28 | ### Code: | 28 | ### Code: |
| 29 | 29 | ||
| @@ -60,10 +60,9 @@ all: check | |||
| 60 | @$(emacs) -f batch-byte-compile $< | 60 | @$(emacs) -f batch-byte-compile $< |
| 61 | 61 | ||
| 62 | ## Ignore any test errors so we can continue to test other files. | 62 | ## Ignore any test errors so we can continue to test other files. |
| 63 | ## (It would be nice if we could get an error when running an | ||
| 64 | ## individual test, but not when running check.) | ||
| 65 | ## But compilation errors are always fatal. | 63 | ## But compilation errors are always fatal. |
| 66 | ## | 64 | WRITE_LOG = >& $@ || { stat=ERROR; cat $@; }; echo $$stat: $@ |
| 65 | |||
| 67 | ## I'd prefer to use -emacs -f ert-run-tests-batch-and-exit rather | 66 | ## I'd prefer to use -emacs -f ert-run-tests-batch-and-exit rather |
| 68 | ## than || true, since the former makes problems more obvious. | 67 | ## than || true, since the former makes problems more obvious. |
| 69 | ## I'd also prefer to @-hide the grep part and not the | 68 | ## I'd also prefer to @-hide the grep part and not the |
| @@ -74,7 +73,7 @@ all: check | |||
| 74 | ## basename duplicates a file in lisp/ (eg eshell.el). | 73 | ## basename duplicates a file in lisp/ (eg eshell.el). |
| 75 | ## ii) Although -l basename will automatically load .el or .elc, | 74 | ## ii) Although -l basename will automatically load .el or .elc, |
| 76 | ## -l ./basename treats basename as a literal file (it would be nice | 75 | ## -l ./basename treats basename as a literal file (it would be nice |
| 77 | ## to change this). | 76 | ## to change this; bug#17848 - if that gets done, this can be simplified). |
| 78 | ## | 77 | ## |
| 79 | ## Beware: it approximates `no-byte-compile', so watch out for false-positives! | 78 | ## Beware: it approximates `no-byte-compile', so watch out for false-positives! |
| 80 | %.log: ${srcdir}/%.el | 79 | %.log: ${srcdir}/%.el |
| @@ -87,10 +86,7 @@ all: check | |||
| 87 | echo Testing $$loadfile; \ | 86 | echo Testing $$loadfile; \ |
| 88 | stat=OK ; \ | 87 | stat=OK ; \ |
| 89 | $(emacs) -l ert -l $$loadfile \ | 88 | $(emacs) -l ert -l $$loadfile \ |
| 90 | -f ert-run-tests-batch-and-exit >& $@ || { \ | 89 | -f ert-run-tests-batch-and-exit ${WRITE_LOG} |
| 91 | stat=ERROR; \ | ||
| 92 | cat $@; }; \ | ||
| 93 | echo $$stat: $@ | ||
| 94 | 90 | ||
| 95 | ELFILES = $(wildcard ${srcdir}/*.el) | 91 | ELFILES = $(wildcard ${srcdir}/*.el) |
| 96 | LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES})) | 92 | LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES})) |
| @@ -102,11 +98,11 @@ TESTS = ${LOGFILES:.log=} | |||
| 102 | 98 | ||
| 103 | .PHONY: ${TESTS} | 99 | .PHONY: ${TESTS} |
| 104 | 100 | ||
| 105 | ## The short aliases that always re-run the tests. | 101 | ## The short aliases that always re-run the tests, with no logging. |
| 106 | define test_template | 102 | define test_template |
| 107 | $(1): | 103 | $(1): |
| 108 | @test ! -f $(1).log || mv $(1).log $(1).log~ | 104 | @test ! -f $(1).log || mv $(1).log $(1).log~ |
| 109 | @${MAKE} $(1).log | 105 | @${MAKE} $(1).log WRITE_LOG= |
| 110 | endef | 106 | endef |
| 111 | 107 | ||
| 112 | $(foreach test,${TESTS},$(eval $(call test_template,${test}))) | 108 | $(foreach test,${TESTS},$(eval $(call test_template,${test}))) |