.PHONY: make-version build
# This is necessary only if you want to automatically produce a new
-# _version.py file from the current git/darcs history.
+# _version.py file from the current git/darcs history (without doing a build).
make-version:
$(PYTHON) ./setup.py update_version
$(MAKE) make-version
# It is unnecessary to have this depend on build or src/allmydata/_version.py,
-# since 'setup.py build' always updates the version using 'darcsver --count-all-patches'.
+# since 'setup.py build' always updates the version.
build:
$(PYTHON) setup.py build
touch .built
rm -f .coverage
$(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST)
-quicktest:
+quicktest: make-version
$(TAHOE) debug trial $(TRIALARGS) $(TEST)
# "make tmpfstest" may be a faster way of running tests on Linux. It works best when you have
tmpfstest:
time make _tmpfstest 'TMPDIR=$(shell mktemp -d --tmpdir=.)'
-_tmpfstest:
+_tmpfstest: make-version
sudo mount -t tmpfs -o size=400m tmpfs '$(TMPDIR)'
-$(TAHOE) debug trial --rterrors '--temp-directory=$(TMPDIR)/_trial_temp' $(TRIALARGS) $(TEST)
sudo umount '$(TMPDIR)'
# coverage-output" for a pretty HTML report. Also see "make .coverage.el" and
# misc/coding_tools/coverage.el for emacs integration.
-quicktest-coverage:
+quicktest-coverage: make-version
rm -f .coverage
PYTHONPATH=. $(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST)
# on my laptop, "quicktest" takes 239s, "quicktest-coverage" takes 304s
def trial(config):
sys.argv = ['trial'] + config.trial_args
+ from allmydata._version import full_version
+ if full_version.endswith("-dirty"):
+ print >>sys.stderr
+ print >>sys.stderr, "WARNING: the source tree has been modified since the last commit."
+ print >>sys.stderr, "(It is usually preferable to commit, then test, then amend the commit(s)"
+ print >>sys.stderr, "if the tests fail.)"
+ print >>sys.stderr
+
# This does not return.
twisted_trial.run()