Makefile
author Pierre-Yves David <pierre-yves.david@fb.com>
Mon, 14 Mar 2016 18:43:23 +0000
changeset 1906 5e9ce6310720
parent 1893 9d1157fcdc6c
child 2020 143c8e4dc22d
permissions -rw-r--r--
stack: show the currently active changeset and unstable ones Still super basic, but give a basic idea of the feature. We use both symbols and explicit text because symbols are cool but text is more explicit
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1839
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
     1
PYTHON=python
1879
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
     2
ifeq ($(HGROOT),)
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
     3
  $(error HGROOT is not set to the root of the hg source tree)
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
     4
endif
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
     5
TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
     6
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
     7
HGTESTS=$(HGROOT)/tests
1839
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
     8
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
     9
help:
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    10
	@echo 'Commonly used make targets:'
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    11
	@echo '  tests              - run all tests in the automatic test suite'
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    12
	@echo '  all-version-tests - run all tests against many hg versions'
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    13
	@echo '  tests-%s           - run all tests in the specified hg version'
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    14
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    15
all: help
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    16
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    17
tests:
1879
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
    18
	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS)
1839
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    19
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    20
test-%:
1879
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
    21
	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS) $@
1839
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    22
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    23
tests-%:
1879
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
    24
	hg -R $(HGROOT) checkout $$(echo $@ | sed s/tests-//) && \
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
    25
	(cd $(HGROOT) ; $(MAKE) clean ) && \
bd5c2922a8ad Makefile: rework running of tests
Augie Fackler <raf@durin42.com>
parents: 1839
diff changeset
    26
	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS)
1839
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    27
1893
9d1157fcdc6c Makefile: meant tests-@ not tests-tip
Augie Fackler <raf@durin42.com>
parents: 1883
diff changeset
    28
all-version-tests: tests-3.7 tests-@
1839
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    29
1bc5e62fc0c7 Initial dumb version of topics.
Augie Fackler <augie@google.com>
parents:
diff changeset
    30
.PHONY: tests all-version-tests