Makefile
author Augie Fackler <raf@durin42.com>
Mon, 14 Mar 2016 20:11:47 -0400
changeset 1879 bd5c2922a8ad
parent 1839 1bc5e62fc0c7
child 1883 ebf146c77709
permissions -rw-r--r--
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.)

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:'
	@echo '  tests              - run all tests in the automatic test suite'
	@echo '  all-version-tests - run all tests against many hg versions'
	@echo '  tests-%s           - run all tests in the specified hg version'

all: help

tests:
	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS)

test-%:
	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS) $@

tests-%:
	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

.PHONY: tests all-version-tests