Browse Source

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.
Achim Gratz 13 years ago
parent
commit
4a7ed95010
3 changed files with 18 additions and 4 deletions
  1. 1 0
      Makefile
  2. 9 2
      default.mk
  3. 8 2
      targets.mk

+ 1 - 0
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)

+ 9 - 2
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)")' \

+ 8 - 2
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