| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
__version__ = '0.2.3' |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
__SOFTWARE_HOME = os.environ.get('SOFTWARE_HOME', '/home/fenix/local/opt/Zope-2.8.6/lib/python') |
|---|
| 45 |
__INSTANCE_HOME = os.environ.get('INSTANCE_HOME', '/home/fenix/local/opt/Testing') |
|---|
| 46 |
|
|---|
| 47 |
if __SOFTWARE_HOME.endswith(os.sep): |
|---|
| 48 |
__SOFTWARE_HOME = os.path.dirname(__SOFTWARE_HOME) |
|---|
| 49 |
|
|---|
| 50 |
if __INSTANCE_HOME.endswith(os.sep): |
|---|
| 51 |
__INSTANCE_HOME = os.path.dirname(__INSTANCE_HOME) |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
if not sys.modules.has_key('Testing'): |
|---|
| 56 |
p0 = sys.path[0] |
|---|
| 57 |
if p0 and __name__ == '__main__': |
|---|
| 58 |
os.chdir(p0) |
|---|
| 59 |
p0 = '' |
|---|
| 60 |
s = __SOFTWARE_HOME |
|---|
| 61 |
p = d = s and s or os.getcwd() |
|---|
| 62 |
while d: |
|---|
| 63 |
if os.path.isdir(os.path.join(p, 'Testing')): |
|---|
| 64 |
zope_home = os.path.dirname(os.path.dirname(p)) |
|---|
| 65 |
sys.path[:1] = [p0, p, zope_home] |
|---|
| 66 |
break |
|---|
| 67 |
p, d = s and ('','') or os.path.split(p) |
|---|
| 68 |
else: |
|---|
| 69 |
print 'Unable to locate Testing package.', |
|---|
| 70 |
print 'You might need to set SOFTWARE_HOME.' |
|---|
| 71 |
sys.exit(1) |
|---|
| 72 |
|
|---|
| 73 |
import Testing, unittest |
|---|
| 74 |
execfile(os.path.join(os.path.dirname(Testing.__file__), 'common.py')) |
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
if 1: |
|---|
| 79 |
|
|---|
| 80 |
p = os.path.join(os.path.dirname(Testing.__file__), 'ZopeTestCase') |
|---|
| 81 |
|
|---|
| 82 |
if not os.path.isdir(p): |
|---|
| 83 |
print 'Unable to locate ZopeTestCase package.', |
|---|
| 84 |
print 'You might need to install ZopeTestCase.' |
|---|
| 85 |
sys.exit(1) |
|---|
| 86 |
|
|---|
| 87 |
ztc_common = 'ztc_common.py' |
|---|
| 88 |
ztc_common_global = os.path.join(p, ztc_common) |
|---|
| 89 |
|
|---|
| 90 |
f = 0 |
|---|
| 91 |
if os.path.exists(ztc_common_global): |
|---|
| 92 |
execfile(ztc_common_global) |
|---|
| 93 |
f = 1 |
|---|
| 94 |
if os.path.exists(ztc_common): |
|---|
| 95 |
execfile(ztc_common) |
|---|
| 96 |
f = 1 |
|---|
| 97 |
|
|---|
| 98 |
if not f: |
|---|
| 99 |
print 'Unable to locate %s.' % ztc_common |
|---|
| 100 |
sys.exit(1) |
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
print 'SOFTWARE_HOME: %s' % os.environ.get('SOFTWARE_HOME', 'Not set') |
|---|
| 105 |
print 'INSTANCE_HOME: %s' % os.environ.get('INSTANCE_HOME', 'Not set') |
|---|
| 106 |
sys.stdout.flush() |
|---|
| 107 |
|
|---|