## 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!
-SELECTOR_DEFAULT=(quote (not (tag :expensive-test)))
-SELECTOR_EXPENSIVE=nil
-SELECTOR=
+SELECTOR_DEFAULT = (quote (not (tag :expensive-test)))
+SELECTOR_EXPENSIVE = nil
+ifndef SELECTOR
+SELECTOR_ACTUAL=$(SELECTOR_DEFAULT)
+else
+SELECTOR_ACTUAL=$(SELECTOR)
+endif
+
+
%.log: %.el
@if grep '^;.*no-byte-compile: t' $< > /dev/null; then \
loadfile=$<; \
stat=OK ; \
mkdir --parents $(dir $@) ; \
$(emacs) -l ert -l $$loadfile \
- --eval "(ert-run-tests-batch-and-exit ${SELECTOR})" ${WRITE_LOG}
+ --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG}
ELFILES = $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \
-path "*resources" -prune -o -name "*el" -print)
## have to run Emacs for every make invocation, and it might not be
## available during clean.
-include make-test-deps.mk
-## Rerun default tests.
-check:
- @${MAKE} check-doit SELECTOR="${SELECTOR_DEFAULT}"
+## Rerun all default tests.
+check: mostlyclean
+ @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}"
-## Rerun also expensive tests.
+## Rerun all default and expensive tests.
.PHONY: check-expensive
-check-expensive:
+check-expensive: mostlyclean
@${MAKE} check-doit SELECTOR="${SELECTOR_EXPENSIVE}"
-## Re-run all the tests every time.
-.PHONY: check-doit
-check-doit:
- -@for f in $(LOGFILES); do test ! -f $$f || mv $$f $$f~; done
- @${MAKE} check-maybe
-
-## Only re-run tests whose .log is older than the test.
+## Only re-run default tests whose .log is older than the test.
.PHONY: check-maybe
-check-maybe: ${LOGFILES}
+check-maybe:
+ @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}"
+
+## Run the tests.
+.PHONY: check-doit
+check-doit: ${LOGFILES}
$(emacs) -l ert -f ert-summarize-tests-batch-and-exit $^
.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
-clean mostlyclean:
+mostlyclean:
+ -@for f in *.log; do test ! -f $$f || mv $$f $$f~; done
+
+clean:
-rm -f ${LOGFILES} ${LOGSAVEFILES}
-rm make-test-deps.mk