diff options
author | Achim Gratz <Stromeko@Stromeko.DE> | 2012-02-16 21:24:51 +0100 |
---|---|---|
committer | Achim Gratz <Stromeko@Stromeko.DE> | 2012-04-20 21:04:13 +0200 |
commit | 3bbd458780926ea398d8b32400a858de79ccdf8b (patch) | |
tree | 355a1498aa5b78a57f70059a7a5c26aa1398c858 | |
parent | 035f24673b2170c284859479aabb588f0330f8bc (diff) | |
download | org-mode-3bbd458780926ea398d8b32400a858de79ccdf8b.tar.gz |
add cleaning of temporary test files (with option to keep them)
default.mk: add $(testdir) definition based on $(TMPDIR), which
defaults to "/tmp" if not already defined
targets.mk(check): call test suite with TMPDIR=$(testdir) and remove
direactory after successful run of testsuite. Do not remove
temporary test files if $(TEST_NO_AUTOCLEAN) is set to a non-empty
value.
targets.mk(cleandirs): refactor the first part of what cleanall
had been doing.
targets.mk(cleanall): run cleantest and cleandirs, then remove
backup files.
targets.mk(cleanlisp): remove backup files.
targets.mk(cleandoc): remove backup files.
targets.mk(cleanall): run cleantest and cleandirs, then remove
backup files.
targets.mk(cleantest): removal of temporary test files.
-rw-r--r-- | default.mk | 4 | ||||
-rw-r--r-- | targets.mk | 20 |
2 files changed, 19 insertions, 5 deletions
@@ -19,6 +19,10 @@ datadir = $(prefix)/emacs/etc/org # Where info files go. infodir = $(prefix)/info +# where to create temporary files for the testsuite +TMPDIR ?= /tmp +testdir = $(TMPDIR)/tmp-orgtest + ##---------------------------------------------------------------------- ## YOU MAY NEED TO ADAPT THESE DEFINITIONS ##---------------------------------------------------------------------- @@ -23,7 +23,7 @@ endif .PHONY: default all up2 update compile lisp doc etc \ check test install info html pdf card docs $(INSTSUB) \ autoloads cleanall clean cleancontrib cleanrel clean-install \ - cleanelc cleanlisp cleandoc cleandocs + cleanelc cleandirs cleanlisp cleandoc cleandocs cleantest all \ compile:: lisp @@ -41,7 +41,11 @@ check test:: all check test \ test-dirty:: - $(BTEST) + -$(MKDIR) $(testdir) + TMPDIR=$(testdir) $(BTEST) +ifeq ($(TEST_NO_AUTOCLEAN),) # define this variable to leave $(testdir) around for inspection + $(MAKE) cleantest +endif up2: update $(SUDO) $(MAKE) install @@ -66,13 +70,14 @@ $(INSTSUB): autoloads: lisp $(MAKE) -C $< $@ -cleanall: $(SUBDIRS) - $(foreach dir, $?, $(MAKE) -C $(dir) $@;) - -$(FIND) . -name \*~ -exec $(RM) {} \; +cleandirs: $(SUBDIRS) + $(foreach dir, $?, $(MAKE) -C $(dir) cleanall;) clean: cleanrel $(MAKE) -C lisp clean $(MAKE) -C doc clean + +cleanall: cleandirs cleantest -$(FIND) . -name \*~ -exec $(RM) {} \; cleancontrib: @@ -85,6 +90,11 @@ cleanrel: cleanelc cleanlisp: $(MAKE) -C lisp clean + -$(FIND) lisp -name \*~ -exec $(RM) {} \; cleandoc cleandocs: $(MAKE) -C doc clean + -$(FIND) doc -name \*~ -exec $(RM) {} \; + +cleantest: + $(RMR) $(testdir) |