diff options
| author | Glenn Morris | 2014-06-27 21:11:04 -0400 |
|---|---|---|
| committer | Glenn Morris | 2014-06-27 21:11:04 -0400 |
| commit | 06a9b8f6eb1108cc63d0c1dd95275dfa8b37a291 (patch) | |
| tree | 155f14d5d92bc9edda050b0ac75494d064e115fd | |
| parent | 8076b124381292d7686ee9e4b2d86e683ed93bd2 (diff) | |
| download | emacs-06a9b8f6eb1108cc63d0c1dd95275dfa8b37a291.tar.gz emacs-06a9b8f6eb1108cc63d0c1dd95275dfa8b37a291.zip | |
Add short test aliases that always re-run the tests
* test/automated/Makefile.in (TESTS): New list of short PHONY aliases.
(test_template): New definition. Apply to TESTS.
| -rw-r--r-- | test/ChangeLog | 5 | ||||
| -rw-r--r-- | test/automated/Makefile.in | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index ba10d90aab1..f67fad959fa 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-06-28 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * automated/Makefile.in (TESTS): New list of short PHONY aliases. | ||
| 4 | (test_template): New definition. Apply to TESTS. | ||
| 5 | |||
| 1 | 2014-06-27 Glenn Morris <rgm@gnu.org> | 6 | 2014-06-27 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * automated/Makefile.in (check-maybe): Rename from check. | 8 | * automated/Makefile.in (check-maybe): Rename from check. |
diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in index fd5d92cc571..da14fda88d6 100644 --- a/test/automated/Makefile.in +++ b/test/automated/Makefile.in | |||
| @@ -17,6 +17,16 @@ | |||
| 17 | # You should have received a copy of the GNU General Public License | 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | 18 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 19 | 19 | ||
| 20 | ### Commentary: | ||
| 21 | |||
| 22 | ## Some targets: | ||
| 23 | ## check: re-run all tests | ||
| 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 | ||
| 26 | ## filename: re-run tests from filename.el(c) | ||
| 27 | |||
| 28 | ### Code: | ||
| 29 | |||
| 20 | SHELL = @SHELL@ | 30 | SHELL = @SHELL@ |
| 21 | 31 | ||
| 22 | srcdir = @srcdir@ | 32 | srcdir = @srcdir@ |
| @@ -84,11 +94,24 @@ all: check | |||
| 84 | 94 | ||
| 85 | ELFILES = $(wildcard ${srcdir}/*.el) | 95 | ELFILES = $(wildcard ${srcdir}/*.el) |
| 86 | LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES})) | 96 | LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES})) |
| 97 | TESTS = ${LOGFILES:.log=} | ||
| 87 | 98 | ||
| 88 | ## If we have to interrupt a hanging test, preserve the log so we can | 99 | ## If we have to interrupt a hanging test, preserve the log so we can |
| 89 | ## see what the problem was. | 100 | ## see what the problem was. |
| 90 | .PRECIOUS: %.log | 101 | .PRECIOUS: %.log |
| 91 | 102 | ||
| 103 | .PHONY: ${TESTS} | ||
| 104 | |||
| 105 | ## The short aliases that always re-run the tests. | ||
| 106 | define test_template | ||
| 107 | $(1): | ||
| 108 | @test ! -f $(1).log || mv $(1).log $(1).log~ | ||
| 109 | @${MAKE} $(1).log | ||
| 110 | endef | ||
| 111 | |||
| 112 | $(foreach test,${TESTS},$(eval $(call test_template,${test}))) | ||
| 113 | |||
| 114 | |||
| 92 | ## Re-run all the tests every time. | 115 | ## Re-run all the tests every time. |
| 93 | check: | 116 | check: |
| 94 | -@for f in *.log; do test ! -f $$f || mv $$f $$f~; done | 117 | -@for f in *.log; do test ! -f $$f || mv $$f $$f~; done |