branch: elpa/magit
commit 2334c627bed20e87ab071d07ea5e4938f56b54b4
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    make: Improve test targets
---
 Makefile      |  7 +++++--
 test/Makefile | 26 +++++++++++---------------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/Makefile b/Makefile
index 2ae7c027e28..b370717bc97 100644
--- a/Makefile
+++ b/Makefile
@@ -115,7 +115,7 @@ install-info: info
 
 ## Test ##############################################################
 
-test:
+test: lisp
        @$(MAKE) -C test test
 
 test-interactive:
@@ -133,7 +133,7 @@ check-declare:
 
 ## Clean #############################################################
 
-clean: clean-lisp clean-docs clean-archives
+clean: clean-lisp clean-docs clean-test clean-archives
 
 clean-lisp:
        @$(MAKE) -C lisp clean
@@ -141,6 +141,9 @@ clean-lisp:
 clean-docs:
        @$(MAKE) -C docs clean
 
+clean-test:
+       @$(MAKE) -C test clean
+
 clean-archives:
        @$(RM) *.tar.gz *.tar lisp/magit-version.el
        @$(RMDIR) magit-$(VERSION)
diff --git a/test/Makefile b/test/Makefile
index 11eec3a8dc3..1850c7639ca 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,25 +1,21 @@
 -include ../config.mk
 include ../default.mk
 
+LOAD_PATH += -L ../lisp
+
 test: lisp
-       @printf "Testing...\n"
-       @$(EMACS_BATCH) --eval "(progn\
-       $$suppress_warnings\
-       (load-file \"$(TOP)test/magit-tests.el\")\
-       (ert-run-tests-batch-and-exit))"
+       @printf "  Testing...\n"
+       @$(EMACS_BATCH) -l $(PKG)-tests -f ert-run-tests-batch-and-exit
 
 test-interactive:
-       @$(EMACS_INTR) --eval "(progn\
-       (load-file \"$(TOP)test/magit-tests.el\")\
-       (ert t))"
+       @$(EMACS_INTR) -l $(PKG)-tests --eval "(ert t)"
 
-lisp: magit-tests.elc
+lisp: $(addprefix ../lisp/,$(ELCS)) $(PKG)-tests.elc
 
 %.elc: %.el
        @printf "Compiling $<\n"
-       @$(EMACS_BATCH) --eval "(progn\
-       (when (file-exists-p \"$@\")\
-         (delete-file \"$@\"))\
-       (setq with-editor-emacsclient-executable nil)\
-       $$suppress_warnings)" \
-       -f batch-byte-compile $<
+       @$(EMACS_BATCH) --funcall batch-byte-compile $<
+
+clean:
+       @printf " Cleaning test/*...\n"
+       @rm -rf $(PKG)-tests.elc

Reply via email to