Makefile: add correct generated build/lib.linux-i686-2.4 directory to PYTHONPATH for tests

This commit is contained in:
Brian Warner 2006-12-14 03:59:51 -07:00
parent 3490378551
commit 07fd8766d1
2 changed files with 28 additions and 3 deletions

View File

@ -12,17 +12,32 @@ run-client2:
run-client3: run-client3:
cd client-basedir3 && PYTHONPATH=.. twistd -noy ../client.tac cd client-basedir3 && PYTHONPATH=.. twistd -noy ../client.tac
test: .PHONY: build
trial allmydata build:
python setup.py build
# where does this go? in a platform-specific directory under build/ . Use
# builddir.py to locate it.
ifneq ($(PYTHONPATH),)
PP=PYTHONPATH=${PYTHONPATH}:$(shell python ./builddir.py)
else
PP=PYTHONPATH=$(shell python ./builddir.py)
endif
test: build
$(PP) trial allmydata
test-figleaf: test-figleaf:
trial --reporter=bwverbose-figleaf allmydata $(PP) trial --reporter=bwverbose-figleaf allmydata
figleaf2html -d coverage-html -x allmydata/test/figleaf.excludes figleaf2html -d coverage-html -x allmydata/test/figleaf.excludes
# after doing test-figleaf, point your browser at coverage-html/index.html # after doing test-figleaf, point your browser at coverage-html/index.html
figleaf-output: figleaf-output:
figleaf2html -d coverage-html -x allmydata/test/figleaf.excludes figleaf2html -d coverage-html -x allmydata/test/figleaf.excludes
clean:
rm -rf build
create_dirs: create_dirs:
mkdir -p queen-basedir mkdir -p queen-basedir
mkdir -p client-basedir mkdir -p client-basedir

10
builddir.py Normal file
View File

@ -0,0 +1,10 @@
#! /usr/bin/python
import sys, os.path
from distutils.util import get_platform
# because we use extension modules, we need a platform+version-specific
# libdir. If we were using a pure-python module, this would just be "lib".
plat_specifier = ".%s-%s" % (get_platform(), sys.version[0:3])
libdir = os.path.join("build", "lib" + plat_specifier)
print libdir