]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - misc/build_helpers/test-with-fake-pkg.py
Change misc/build_helpers/test-with-fake-pkg to use 'setup.py trial'. refs #1296
[tahoe-lafs/tahoe-lafs.git] / misc / build_helpers / test-with-fake-pkg.py
1 #!/usr/bin/env python
2
3 # We put a fake "pycryptopp-0.5.13" package on the PYTHONPATH so that
4 # the build system thinks pycryptopp-0.5.13 is already installed. Then
5 # we execute 'setup.py trial'. If the build system is too naive/greedy
6 # about finding dependencies, it will latch onto the
7 # "pycryptopp-0.5.13" and then will be unable to satisfy the
8 # requirement (from _auto_deps.py) for pycryptopp >= 0.5.20 (or
9 # pycryptopp >= 0.5.14, depending on machine architecture). This is
10 # currently happening on trunk, see #1190. So with trunk, running
11 # test-with-fake-pkg.py shows a failure, but with the ticket1190
12 # branch, test-with-fake-pkg.py succeeds.
13
14 import os, subprocess, sys
15
16 fakepkgdir = 'misc/build_helpers/fakepkgs'
17 fakepkgname = "pycryptopp"
18 fakepkgversion = "0.5.13"
19 testsuite = "allmydata.test.test_backupdb"
20
21 pkgdirname = os.path.join(os.getcwd(), fakepkgdir, '%s-%s.egg' % (fakepkgname, fakepkgversion))
22
23 try:
24     os.makedirs(pkgdirname)
25 except OSError:
26     # probably already exists
27     pass
28
29 os.environ['PYTHONPATH']=pkgdirname+os.pathsep+os.environ.get('PYTHONPATH','')
30 sys.exit(subprocess.call([sys.executable, 'setup.py', 'trial', '-s', testsuite], env=os.environ))