aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-06-27 21:11:04 -0400
committerGlenn Morris2014-06-27 21:11:04 -0400
commit06a9b8f6eb1108cc63d0c1dd95275dfa8b37a291 (patch)
tree155f14d5d92bc9edda050b0ac75494d064e115fd
parent8076b124381292d7686ee9e4b2d86e683ed93bd2 (diff)
downloademacs-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/ChangeLog5
-rw-r--r--test/automated/Makefile.in23
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 @@
12014-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
12014-06-27 Glenn Morris <rgm@gnu.org> 62014-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
20SHELL = @SHELL@ 30SHELL = @SHELL@
21 31
22srcdir = @srcdir@ 32srcdir = @srcdir@
@@ -84,11 +94,24 @@ all: check
84 94
85ELFILES = $(wildcard ${srcdir}/*.el) 95ELFILES = $(wildcard ${srcdir}/*.el)
86LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES})) 96LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES}))
97TESTS = ${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.
106define test_template
107$(1):
108 @test ! -f $(1).log || mv $(1).log $(1).log~
109 @${MAKE} $(1).log
110endef
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.
93check: 116check:
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