From 4a7ed95010d20c0f62bf9c26b331e1e353444585 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 4 Jan 2012 21:02:14 +0100 Subject: [PATCH] introduce new make target "test" Makefile: add help for target "test" default.mk: more sane location for local data, add $(BTEST) that will run the test in batch mode. Some tests require non-standard packages, introduce $(BTEST_EXTRA) in order to add options so they can be found. targets.mk: new target "test" that implies "all" and then runs all test. Hidden target "test-dirty" runs tests without doing compilation. --- Makefile | 1 + default.mk | 11 +++++++++-- targets.mk | 10 ++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8f52015b2..7e82e4a4a 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ targets help: $(info make pdf - make pdf documentation) $(info make card - make refcards documentation) $(info ) + $(info make test - build org and run all test suite) $(info make clean - clean Org ELisp and documentation files) $(info make compile - cleanly compile Org ELisp files) $(info make compile-dirty - compile Org ELisp without cleaning) diff --git a/default.mk b/default.mk index 0d32e3a51..cdbcb499b 100644 --- a/default.mk +++ b/default.mk @@ -12,7 +12,7 @@ prefix = /usr/share lispdir = $(prefix)/emacs/site-lisp/org # Where local data files go. -datadir = $(lispdir)/etc +datadir = $(prefix)/emacs/etc/org # Where info files go. infodir = $(prefix)/info @@ -22,9 +22,16 @@ infodir = $(prefix)/info ##---------------------------------------------------------------------- # Using emacs in batch mode. - BATCH = $(EMACS) -batch -Q -L . +# run tests +BTEST = $(EMACS) -batch \ + $(BTEST_EXTRA) \ + -L lisp/ \ + -l testing/org-test.el \ + -eval "(setq org-confirm-babel-evaluate nil)" \ + -f org-test-run-batch-tests + # How to byte-compile the whole source directory ELCDIR = $(BATCH) \ --eval '(defconst org-release "$(ORGVERSION)")' \ diff --git a/targets.mk b/targets.mk index 49795fc39..02d1be09a 100644 --- a/targets.mk +++ b/targets.mk @@ -21,8 +21,8 @@ ifneq ($(GITSTATUS),) endif .PHONY: default all up2 update compile lisp doc etc \ - install info html pdf card docs $(INSTSUB) \ - autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel + test install info html pdf card docs $(INSTSUB) \ + autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel clean-install all \ compile:: lisp @@ -36,6 +36,12 @@ all \ clean-install:: $(SUBDIRS) $(foreach dir, $?, $(MAKE) -C $(dir) $@;) +test:: all + +test \ +test-dirty:: + $(BTEST) + up2: update sudo ${MAKE} install -- 2.11.4.GIT