OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python3 | |
Jim Stichnoth
2016/04/04 21:26:51
The rest of our python scripts specify python2. C
Eric Holk
2016/04/04 22:23:22
Done.
| |
2 | |
3 #===- subzero/wasm-run-torture-tests.py - Subzero WASM Torture Test Driver ===// | |
4 # | |
5 # The Subzero Code Generator | |
6 # | |
7 # This file is distributed under the University of Illinois Open Source | |
8 # License. See LICENSE.TXT for details. | |
9 # | |
10 #===-----------------------------------------------------------------------===// | |
11 | |
12 import glob | |
13 import os | |
14 import sys | |
15 | |
16 success_count = 0 | |
17 fail_count = 0 | |
18 failures = [] | |
19 | |
20 def run_test(test_file, verbose=False): | |
21 global success_count | |
22 global fail_count | |
23 | |
24 cmd = """LD_LIBRARY_PATH=../../../../v8/out/native/lib.target ./pnacl-sz \ | |
25 -filetype=asm -target=arm32 {} -threads=0 -O2 \ | |
26 -verbose=wasm""".format(test_file) | |
27 | |
28 if not verbose: | |
29 cmd += " &> /dev/null" | |
30 | |
31 sys.stdout.write(test_file + "..."); | |
32 status = os.system(cmd); | |
33 if status != 0: | |
34 fail_count += 1 | |
35 print('\033[1;31m[fail]\033[1;m') | |
36 failures.append(test_file) | |
37 else: | |
38 success_count += 1 | |
39 print('\033[1;32m[ok]\033[1;m') | |
40 | |
41 | |
42 verbose = False | |
43 | |
44 if len(sys.argv) > 1: | |
45 test_files = sys.argv[1:] | |
46 verbose = True | |
47 else: | |
48 test_files = glob.glob("./torture-s2wasm-sexpr-wasm.old/*.wasm") | |
49 | |
50 for test_file in test_files: | |
51 run_test(test_file, verbose) | |
52 | |
53 if len(failures) > 0: | |
54 print("Failures:") | |
55 for f in failures: | |
56 print(" \033[1;31m" + f + "\033[1;m") | |
57 print("{} / {} tests passed".format(success_count, success_count + fail_count)) | |
OLD | NEW |