Makefile: rework running of tests
authorAugie Fackler <raf@durin42.com>
Mon, 14 Mar 2016 20:11:47 -0400
changeset 1879 bd5c2922a8ad
parent 1878 c44f161575ba
child 1880 4907f2aed924
Makefile: rework running of tests This makes running tests easier without depending on our own copy of run-tests.py (though I'd still prefer to keep that around.)
Makefile
--- a/Makefile	Sat Mar 12 12:36:25 2016 +0000
+++ b/Makefile	Mon Mar 14 20:11:47 2016 -0400
@@ -1,4 +1,10 @@
 PYTHON=python
+ifeq ($(HGROOT),)
+  $(error HGROOT is not set to the root of the hg source tree)
+endif
+TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
+
+HGTESTS=$(HGROOT)/tests
 
 help:
 	@echo 'Commonly used make targets:'
@@ -9,16 +15,15 @@
 all: help
 
 tests:
-	cd tests && $(PYTHON) run-tests.py --with-hg=`which hg` $(TESTFLAGS)
+	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS)
 
 test-%:
-	cd tests && $(PYTHON) run-tests.py --with-hg=`which hg` $(TESTFLAGS) $@
+	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS) $@
 
 tests-%:
-	@echo "Path to crew repo is $(CREW) - set this with CREW= if needed."
-	hg -R $(CREW) checkout $$(echo $@ | sed s/tests-//) && \
-	(cd $(CREW) ; $(MAKE) clean ) && \
-	cd tests && $(PYTHON) $(CREW)/tests/run-tests.py $(TESTFLAGS)
+	hg -R $(HGROOT) checkout $$(echo $@ | sed s/tests-//) && \
+	(cd $(HGROOT) ; $(MAKE) clean ) && \
+	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS)
 
 all-version-tests: tests-tip