Mercurial > hg
comparison Makefile @ 24194:00809c43d72c
Makefile: introduce testpy-% target for testing with a specifc Python
This makes it easy to do 'make testpy-2.4.6 TESTFLAGS="-j 16"' and the
Makefile will build Python if needed and then run tests (with -j 16)
with the resulting Python.
You can set the environment variable HGPYTHONS to a nice location on
your machine to cache the Python builds globally. If that's not set,
it builds them inside build/pythons.
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 04 Feb 2015 12:26:16 -0500 |
parents | d0ef40776999 |
children | 250d9cf97fb3 |
comparison
equal
deleted
inserted
replaced
24193:fa4642439aa0 | 24194:00809c43d72c |
---|---|
5 # % make PREFIX=/opt/ install | 5 # % make PREFIX=/opt/ install |
6 | 6 |
7 PREFIX=/usr/local | 7 PREFIX=/usr/local |
8 export PREFIX | 8 export PREFIX |
9 PYTHON=python | 9 PYTHON=python |
10 $(eval HGROOT := $(shell pwd)) | |
11 HGPYTHONS ?= $(HGROOT)/build/pythons | |
10 PURE= | 12 PURE= |
11 PYFILES:=$(shell find mercurial hgext doc -name '*.py') | 13 PYFILES:=$(shell find mercurial hgext doc -name '*.py') |
12 DOCFILES=mercurial/help/*.txt | 14 DOCFILES=mercurial/help/*.txt |
13 export LANGUAGE=C | 15 export LANGUAGE=C |
14 export LC_ALL=C | 16 export LC_ALL=C |
95 tests: | 97 tests: |
96 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) | 98 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) |
97 | 99 |
98 test-%: | 100 test-%: |
99 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@ | 101 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@ |
102 | |
103 testpy-%: | |
104 @echo Looking for Python $* in $(HGPYTHONS) | |
105 [ -e $(HGPYTHONS)/$*/bin/python ] || ( \ | |
106 cd $$(mktemp --directory --tmpdir) && \ | |
107 $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python ) | |
108 cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS) | |
100 | 109 |
101 check-code: | 110 check-code: |
102 hg manifest | xargs python contrib/check-code.py | 111 hg manifest | xargs python contrib/check-code.py |
103 | 112 |
104 update-pot: i18n/hg.pot | 113 update-pot: i18n/hg.pot |