-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path3test.py
More file actions
executable file
·53 lines (44 loc) · 1.11 KB
/
3test.py
File metadata and controls
executable file
·53 lines (44 loc) · 1.11 KB
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
47
48
49
50
51
52
53
#!/usr/bin/python
import os
import sys
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file', help='file containing tests list')
args = parser.parse_args()
# will use it as return code for script
test_result = 0
FILE = args.file
devnull = open(os.devnull, "w")
# predefined tests
tests = [
'test_grammar',
'test_opcodes',
'test_dict',
'test_builtin',
'test_exceptions',
'test_types',
'test_unittest',
'test_doctest',
'test_doctest2',
]
# tests from external file
if FILE:
with open(FILE, 'r') as rfile:
tests = rfile.read().splitlines()
for test in tests:
print("%s..." % test.strip()),
sys.stdout.flush()
try:
ret = subprocess.call(['zvsh', '--zvm-image', 'python.tar',
'python', '-mtest.regrtest', test],
stdout=devnull, stderr=devnull)
except KeyboardInterrupt:
break
if ret:
test_result = 1
print('\033[1;31mfail\033[1;m')
else:
print('\033[1;32mok\033[1;m')
devnull.close()
sys.exit(test_result)