emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 94306c8 1/2: Further simplify test/Makefile, option


From: Noam Postavsky
Subject: [Emacs-diffs] master 94306c8 1/2: Further simplify test/Makefile, optionally load elc tests
Date: Wed, 31 May 2017 07:45:51 -0400 (EDT)

branch: master
commit 94306c8b0d61a53b19dcee18475ea8692b001f5d
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Further simplify test/Makefile, optionally load elc tests
    
    * test/Makefile.in: Use make's error ignoring feature instead of
    suppressing test errors with shell.  Compile test files in the main
    make invocation instead of a recursive 'make' call.  Optionally load
    .elc test files if TEST_LOAD_EL is set to something other than 'yes'.
    Remove obsolete commentary.
---
 test/Makefile.in | 47 +++++++++++++++++++----------------------------
 1 file changed, 19 insertions(+), 28 deletions(-)

diff --git a/test/Makefile.in b/test/Makefile.in
index 8880ee2..0d1663a 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -81,6 +81,10 @@ GDB =
 # supported everywhere.
 TEST_LOCALE = C
 
+# 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
+
 # The actual Emacs command run in the targets below.
 # Prevent any setting of EMACSLOADPATH in user environment causing problems.
 emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \
@@ -91,26 +95,6 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \
 
 all: check
 
-%.elc: %.el
-       $(AM_V_ELC)$(emacs) -f batch-byte-compile $<
-
-## Ignore any test errors so we can continue to test other files.
-## But compilation errors are always fatal.
-WRITE_LOG = > $@ 2>&1 || { stat=ERROR; cat $@; }; echo $$stat: $@
-
-## I'd prefer to use -emacs -f ert-run-tests-batch-and-exit rather
-## than || true, since the former makes problems more obvious.
-## I'd also prefer to @-hide the grep part and not the
-## ert-run-tests-batch-and-exit part.
-##
-## We need to use $loadfile because:
-## i) -L :$srcdir -l basename does not work, because we have files whose
-## basename duplicates a file in lisp/ (eg eshell.el).
-## ii) Although -l basename will automatically load .el or .elc,
-## -l ./basename treats basename as a literal file (it would be nice
-## 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
 ifdef SELECTOR
@@ -127,16 +111,23 @@ else
 SELECTOR_ACTUAL=$(SELECTOR_EXPENSIVE)
 endif
 
-## Byte-compile all test files to test for errors (unless explicitly
-## told not to), but then evaluate the un-byte-compiled files, because
-## they give cleaner stacktraces.
+## Byte-compile all test files to test for errors.
+%.elc: %.el
+       $(AM_V_ELC)$(emacs) -f batch-byte-compile $<
+
+## Save logs, and show logs for failed tests.
+WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
+
+ifeq ($(TEST_LOAD_EL), yes)
+testloadfile = $*.el
+else
+testloadfile = $*
+endif
 
-## Beware: it approximates 'no-byte-compile', so watch out for false-positives!
-%.log: %.el
-       $(AM_V_at)grep '^;.*no-byte-compile: t' $< > /dev/null || ${MAKE} $<c
+## Ignore any test errors so we can continue to test other files.
+%.log: %.elc
        $(AM_V_at)${MKDIR_P} $(dir $@)
-       $(AM_V_GEN)stat=OK ; \
-       HOME=/nonexistent $(emacs) -l ert -l $< \
+       -$(AM_V_GEN)HOME=/nonexistent $(emacs) -l ert -l $(testloadfile) \
          --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" 
${WRITE_LOG}
 
 ifeq (@HAVE_MODULES@, yes)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]