-
Notifications
You must be signed in to change notification settings - Fork 120
/
run_spec_tests.py
38 lines (33 loc) · 1003 Bytes
/
run_spec_tests.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
import os
import sys
import subprocess
def collect_wast(dir):
ret = []
for item in os.listdir(dir):
full_path = os.path.join(dir, item)
if os.path.isfile(full_path) and full_path.endswith(".wast"):
ret.append(full_path)
return ret
wast_files = collect_wast(sys.argv[1])
success_list = []
failure_list = []
for name in wast_files:
try:
json_name = name + ".json"
ret = subprocess.call(["wast2json", name, "-o", json_name ])
if ret != 0:
raise Exception("wast2json")
ret = subprocess.call(["./test_runner", json_name])
if ret != 0:
raise Exception("test_runner")
success_list.append(name)
except Exception as e:
print(e)
failure_list.append(name)
print("Successes:")
print(success_list)
print("Failures:")
print(failure_list)
num_successes = len(success_list)
num_failures = len(failure_list)
print("{} successes, {} failures".format(num_successes, num_failures))