mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 00:24:13 +00:00
fix quicktest: stop using setuptools, add misc/run-with-pythonpath.py, to make it run faster
This commit is contained in:
parent
b998ecf1a1
commit
a0e3c586b2
10
Makefile
10
Makefile
@ -112,9 +112,6 @@ TEST=allmydata
|
||||
test: build src/allmydata/_version.py
|
||||
$(PYTHON) setup.py test $(TRIALARGS) -s $(TEST)
|
||||
|
||||
quicktest: .built .checked-deps
|
||||
$(PYTHON) setup.py test $(TRIALARGS) -s $(TEST)
|
||||
|
||||
fuse-test: .built .checked-deps
|
||||
$(RUNPP) -d contrib/fuse -p -c runtests.py
|
||||
|
||||
@ -122,9 +119,12 @@ test-figleaf: build src/allmydata/_version.py
|
||||
rm -f .figleaf
|
||||
$(PYTHON) setup.py trial --reporter=bwverbose-figleaf -s $(TEST)
|
||||
|
||||
quicktest-figleaf: src/allmydata/_version.py
|
||||
quicktest:
|
||||
$(PYTHON) misc/run-with-pythonpath.py trial $(TRIALARGS) $(TEST)
|
||||
|
||||
quicktest-figleaf:
|
||||
rm -f .figleaf
|
||||
$(PYTHON) setup.py trial --reporter=bwverbose-figleaf -s $(TEST)
|
||||
$(PYTHON) misc/run-with-pythonpath.py trial --reporter=bwverbose-figleaf $(TEST)
|
||||
|
||||
figleaf-output:
|
||||
$(RUNPP) -p -c "misc/figleaf2html -d coverage-html -r src -x misc/figleaf.excludes"
|
||||
|
39
misc/run-with-pythonpath.py
Normal file
39
misc/run-with-pythonpath.py
Normal file
@ -0,0 +1,39 @@
|
||||
# -*- python -*-
|
||||
# you must invoke this with an explicit python, from the tree root
|
||||
|
||||
"""Run an arbitrary command with a PYTHONPATH that will include the Tahoe
|
||||
code, including dependent libraries. Run this like:
|
||||
|
||||
python misc/run-with-pythonpath.py python foo.py
|
||||
or
|
||||
python misc/run-with-pythonpath.py trial -r poll allmydata.test.test_util
|
||||
|
||||
"""
|
||||
|
||||
import os, sys, subprocess
|
||||
|
||||
# figure out where support/lib/pythonX.X/site-packages is
|
||||
# add it to os.environ["PYTHONPATH"]
|
||||
# spawn the child process
|
||||
|
||||
|
||||
def pylibdir(prefixdir):
|
||||
pyver = "python%d.%d" % (sys.version_info[:2])
|
||||
if sys.platform == "win32":
|
||||
return os.path.join(prefixdir, "Lib", "site-packages")
|
||||
else:
|
||||
return os.path.join(prefixdir, "lib", pyver, "site-packages")
|
||||
|
||||
basedir = os.path.dirname(os.path.abspath(__file__))
|
||||
supportlib = pylibdir(os.path.abspath("support"))
|
||||
|
||||
oldpp = os.environ.get("PYTHONPATH", "").split(os.pathsep)
|
||||
if oldpp == [""]:
|
||||
# grr silly split() behavior
|
||||
oldpp = []
|
||||
newpp = os.pathsep.join(oldpp + [supportlib,])
|
||||
os.environ['PYTHONPATH'] = newpp
|
||||
|
||||
command = sys.argv[1:]
|
||||
rc = subprocess.call(command)
|
||||
sys.exit(rc)
|
Loading…
x
Reference in New Issue
Block a user