forked from python-pillow/Pillow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
executable file
·46 lines (36 loc) · 1.47 KB
/
test.py
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
41
42
43
44
45
46
#!/usr/bin/env python3
import subprocess
import os
import glob
import sys
from config import pythons, VIRT_BASE, X64_EXT
def test_one(params):
python, architecture = params
try:
print("Running: %s, %s" % params)
command = [r'%s\%s%s\Scripts\python.exe' %
(VIRT_BASE, python, architecture),
'test-installed.py',
'--processes=-0',
'--process-timeout=30',
]
command.extend(glob.glob('Tests/test*.py'))
proc = subprocess.Popen(command,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
(trace, stderr) = proc.communicate()
status = proc.returncode
print("Done with %s, %s -- %s" % (python, architecture, status))
return (python, architecture, status, trace)
except Exception as msg:
print("Error with %s, %s: %s" % (python, architecture, msg))
return (python, architecture, -1, str(msg))
if __name__ == '__main__':
os.chdir('..')
matrix = [(python, architecture) for python in pythons
for architecture in ('', X64_EXT)]
results = map(test_one, matrix)
for (python, architecture, status, trace) in results:
print("%s%s: %s" % (python, architecture, status and 'ERR' or 'PASS'))
res = all(status for (python, architecture, status, trace) in results)
sys.exit(res)