2014-04-05 01:57:18 +04:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2015-06-16 19:25:36 +03:00
|
|
|
import glob
|
2019-07-06 23:40:53 +03:00
|
|
|
import os
|
|
|
|
import subprocess
|
2015-06-16 19:25:36 +03:00
|
|
|
import sys
|
2014-04-05 01:57:18 +04:00
|
|
|
|
2019-07-06 23:40:53 +03:00
|
|
|
from config import VIRT_BASE, X64_EXT, pythons
|
2014-04-05 01:57:18 +04:00
|
|
|
|
2015-06-20 06:43:14 +03:00
|
|
|
|
2014-04-05 01:57:18 +04:00
|
|
|
def test_one(params):
|
|
|
|
python, architecture = params
|
|
|
|
try:
|
2015-06-20 06:43:14 +03:00
|
|
|
print("Running: %s, %s" % params)
|
2019-06-13 18:54:57 +03:00
|
|
|
command = [
|
2019-09-30 17:56:31 +03:00
|
|
|
r"{}\{}{}\Scripts\python.exe".format(VIRT_BASE, python, architecture),
|
2019-06-13 18:54:57 +03:00
|
|
|
"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)
|
2014-04-05 02:18:14 +04:00
|
|
|
(trace, stderr) = proc.communicate()
|
|
|
|
status = proc.returncode
|
2019-09-30 17:56:31 +03:00
|
|
|
print("Done with {}, {} -- {}".format(python, architecture, status))
|
2014-04-05 01:57:18 +04:00
|
|
|
return (python, architecture, status, trace)
|
|
|
|
except Exception as msg:
|
2019-09-30 17:56:31 +03:00
|
|
|
print("Error with {}, {}: {}".format(python, architecture, msg))
|
2014-04-05 01:57:18 +04:00
|
|
|
return (python, architecture, -1, str(msg))
|
|
|
|
|
|
|
|
|
2019-06-13 18:54:57 +03:00
|
|
|
if __name__ == "__main__":
|
2014-04-05 01:57:18 +04:00
|
|
|
|
2019-06-13 18:54:57 +03:00
|
|
|
os.chdir("..")
|
|
|
|
matrix = [
|
|
|
|
(python, architecture) for python in pythons for architecture in ("", X64_EXT)
|
|
|
|
]
|
2014-04-05 02:18:14 +04:00
|
|
|
|
2015-06-16 19:25:36 +03:00
|
|
|
results = map(test_one, matrix)
|
2014-04-05 01:57:18 +04:00
|
|
|
|
|
|
|
for (python, architecture, status, trace) in results:
|
2019-09-30 17:56:31 +03:00
|
|
|
print("{}{}: {}".format(python, architecture, status and "ERR" or "PASS"))
|
2014-04-05 01:57:18 +04:00
|
|
|
|
2015-06-16 19:25:36 +03:00
|
|
|
res = all(status for (python, architecture, status, trace) in results)
|
|
|
|
sys.exit(res)
|