diff options
Diffstat (limited to 'test/Makefile.in')
-rw-r--r-- | test/Makefile.in | 62 |
1 files changed, 51 insertions, 11 deletions
diff --git a/test/Makefile.in b/test/Makefile.in index 481c418787a..c18099587c0 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -105,16 +105,19 @@ endif # Whether to run tests from .el files in preference to .elc, we do # this by default since it gives nicer stacktraces. -TEST_LOAD_EL ?= yes +# If you just want a pass/fail, setting this to no is much faster. +export TEST_LOAD_EL ?= \ + $(if $(findstring $(MAKECMDGOALS), all check check-maybe),no,yes) + +# Additional settings for ert. +ert_opts = # Maximum length of lines in ert backtraces; nil for no limit. # (if empty, use the default ert-batch-backtrace-right-margin). TEST_BACKTRACE_LINE_LENGTH = -ifeq (${TEST_BACKTRACE_LINE_LENGTH},) -ert_opts = -else -ert_opts = --eval '(setq ert-batch-backtrace-right-margin ${TEST_BACKTRACE_LINE_LENGTH})' +ifneq (${TEST_BACKTRACE_LINE_LENGTH},) +ert_opts += --eval '(setq ert-batch-backtrace-right-margin ${TEST_BACKTRACE_LINE_LENGTH})' endif ifeq (@HAVE_MODULES@, yes) @@ -134,7 +137,7 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \ # exists, or writing to ~/.bzr.log when running bzr commands). TEST_HOME = /nonexistent -test_module_dir := $(srcdir)/data/emacs-module +test_module_dir := data/emacs-module .PHONY: all check @@ -163,6 +166,11 @@ endif ## Save logs, and show logs for failed tests. WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; } +ifdef EMACS_HYDRA_CI +## On Hydra, always show logs for certain problematic tests. +lisp/net/tramp-tests.log \ +: WRITE_LOG = 2>&1 | tee $@ +endif ifeq ($(TEST_LOAD_EL), yes) testloadfile = $*.el @@ -182,11 +190,26 @@ else maybe_exclude_module_tests := -name emacs-module-tests.el -prune -o endif +## Optional list of .el files to exclude from testing. +## Intended for use in automated testing where one or more files +## has some problem and needs to be excluded. +## To avoid writing full name, can use eg %foo-tests.el. +EXCLUDE_TESTS = + +## To speed up parallel builds, put these slow test files (which can +## take longer than all the rest combined) at the start of the list. +SLOW_TESTS = ${srcdir}/lisp/net/tramp-tests.el + ELFILES := $(sort $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \ -path "${srcdir}/data" -prune -o \ -name "*resources" -prune -o \ ${maybe_exclude_module_tests} \ -name "*.el" ! -name ".*" -print)) + +$(foreach slow,${SLOW_TESTS},$(eval ELFILES:= ${slow} $(filter-out ${slow},${ELFILES}))) + +$(foreach exclude,${EXCLUDE_TESTS},$(eval ELFILES:= $(filter-out ${exclude},${ELFILES}))) + ## .log files may be in a different directory for out of source builds LOGFILES := $(patsubst %.el,%.log, \ $(patsubst $(srcdir)/%,%,$(ELFILES))) @@ -231,16 +254,26 @@ else FPIC_CFLAGS = -fPIC endif +GMP_LIB = @GMP_LIB@ +GMP_OBJ = $(if @GMP_OBJ@, ../src/@GMP_OBJ@) + # Note: emacs-module.h is generated from emacs-module.h.in, hence we # look in ../src, not $(srcdir)/../src. -MODULE_CFLAGS = -I../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ +MODULE_CFLAGS = -I../src -I$(srcdir)/../lib \ + $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) test_module = $(test_module_dir)/mod-test${SO} -src/emacs-module-tests.log: $(test_module) +src/emacs-module-tests.log src/emacs-module-tests.elc: $(test_module) + +# In the compilation command, we can't use any object or archive file +# as source because those are not compiled with -fPIC. Therefore we +# use only source files. $(test_module): $(test_module:${SO}=.c) ../src/emacs-module.h + $(AM_V_at)${MKDIR_P} $(dir $@) $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \ - -o $@ $< + -o $@ $< $(GMP_LIB) $(GMP_OBJ:.o=.c) \ + $(srcdir)/../lib/timespec.c $(srcdir)/../lib/gettime.c endif ## Check that there is no 'automated' subdirectory, which would @@ -283,14 +316,15 @@ ifeq ($(TEST_INTERACTIVE), yes) $(TEST_RUN_ERT) else -@${MAKE} -k ${LOGFILES} - @$(emacs) --batch -l ert -f ert-summarize-tests-batch-and-exit ${LOGFILES} + @$(emacs) --batch -l ert --eval \ + "(ert-summarize-tests-batch-and-exit ${SUMMARIZE_TESTS})" ${LOGFILES} endif .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean mostlyclean: -@for f in ${LOGFILES}; do test ! -f $$f || mv $$f $$f~; done - rm -f *.tmp + rm -f ./*.tmp clean: find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE) @@ -304,3 +338,9 @@ distclean: clean rm -f Makefile maintainer-clean: distclean bootstrap-clean + +.PHONY: check-declare + +check-declare: + $(emacs) -l check-declare \ + --eval '(check-declare-directory "$(srcdir)")' |