diff options
author | Glenn Morris <[email protected]> | 2014-06-27 21:11:04 -0400 |
---|---|---|
committer | Glenn Morris <[email protected]> | 2014-06-27 21:11:04 -0400 |
commit | 06a9b8f6eb1108cc63d0c1dd95275dfa8b37a291 (patch) | |
tree | 155f14d5d92bc9edda050b0ac75494d064e115fd /test | |
parent | 8076b124381292d7686ee9e4b2d86e683ed93bd2 (diff) |
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.
Diffstat (limited to 'test')
-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 ba10d90aab..f67fad959f 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-06-28 Glenn Morris <[email protected]> + + * automated/Makefile.in (TESTS): New list of short PHONY aliases. + (test_template): New definition. Apply to TESTS. + 2014-06-27 Glenn Morris <[email protected]> * automated/Makefile.in (check-maybe): Rename from check. diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in index fd5d92cc57..da14fda88d 100644 --- a/test/automated/Makefile.in +++ b/test/automated/Makefile.in @@ -17,6 +17,16 @@ # You should have received a copy of the GNU General Public License # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. +### Commentary: + +## Some targets: +## check: re-run all tests +## 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) + +### Code: + SHELL = @SHELL@ srcdir = @srcdir@ @@ -84,11 +94,24 @@ all: check ELFILES = $(wildcard ${srcdir}/*.el) LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES})) +TESTS = ${LOGFILES:.log=} ## If we have to interrupt a hanging test, preserve the log so we can ## see what the problem was. .PRECIOUS: %.log +.PHONY: ${TESTS} + +## The short aliases that always re-run the tests. +define test_template +$(1): + @test ! -f $(1).log || mv $(1).log $(1).log~ + @${MAKE} $(1).log +endef + +$(foreach test,${TESTS},$(eval $(call test_template,${test}))) + + ## Re-run all the tests every time. check: -@for f in *.log; do test ! -f $$f || mv $$f $$f~; done |