# We never change directory before running Emacs, so a relative file
# name is fine, and makes life easier. If we need to change
# directory, we can use emacs --chdir.
-EMACS = ../../src/emacs
+EMACS = ../src/emacs
EMACS_EXTRAOPT=
$(emacs) -l ert -l $$loadfile \
-f ert-run-tests-batch-and-exit ${WRITE_LOG}
-ELFILES = $(sort $(wildcard ${srcdir}/*.el))
-LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES}))
-TESTS = ${LOGFILES:.log=}
+ELFILES = $(sort $(wildcard ${srcdir}/*.el) $(wildcard ${srcdir}/*/*.el) \
+ $(wildcard ${srcdir}/*/*/*.el) $(wildcard ${srcdir}/*/*/*/*.el))
+LOGFILES = $(patsubst %.el,%.log,${ELFILES})
+TESTS = $(subst ${srcdir}/,,$(LOGFILES:.log=))
## If we have to interrupt a hanging test, preserve the log so we can
## see what the problem was.
## The short aliases that always re-run the tests, with no logging.
define test_template
$(1):
- @test ! -f $(1).log || mv $(1).log $(1).log~
- @${MAKE} $(1).log WRITE_LOG=
+ @test ! -f ${srcdir}/$(1).log || mv ${srcdir}/$(1).log ${srcdir}/$(1).log~
+ @${MAKE} ${srcdir}/$(1).log WRITE_LOG=
endef
$(foreach test,${TESTS},$(eval $(call test_template,${test})))
.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
clean mostlyclean:
- -rm -f *.log *.log~
+ -rm -f ${srcdir}/*.log ${srcdir}/*.log~ ${srcdir}/*/*.log \
+ ${srcdir}/*/*.log~ ${srcdir}/*/*/*.log \
+ ${srcdir}/*/*/*.log~
bootstrap-clean: clean
- -rm -f ${srcdir}/*.elc
+ -rm -f ${srcdir}/*.elc ${srcdir}/*/*.elc ${srcdir}/*/*/*.elc
distclean: clean
rm -f Makefile