# HG changeset patch # User Augie Fackler # Date 1458000707 14400 # Node ID bd5c2922a8ad5db217f013b694654a94106b023c # Parent c44f161575ba5a2618e0c2797db1e78012d38fbf 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.) diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -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