Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/python3 | |
|
JF
2016/03/28 18:17:14
I think the following is more common:
#!/usr/bin/e
Eric Holk
2016/03/29 19:54:12
Done.
| |
| 2 | |
| 3 import glob | |
| 4 import os | |
| 5 import sys | |
| 6 | |
| 7 success_count = 0 | |
| 8 fail_count = 0 | |
| 9 failures = [] | |
| 10 | |
| 11 def run_test(test_file, verbose=False): | |
| 12 global success_count | |
| 13 global fail_count | |
| 14 | |
| 15 cmd = "LD_LIBRARY_PATH=~/nacl/v8/out/native/lib.target ./pnacl-sz -filetype=as m -target=arm32 {} -threads=0 -O2 -verbose=wasm".format(test_file) | |
|
Jim Stichnoth
2016/03/29 17:49:57
80-col
Yucky absolute paths.
-target=arm32???
M
Eric Holk
2016/03/29 22:58:07
Done.
| |
| 16 | |
| 17 if not verbose: | |
| 18 cmd += " &> /dev/null" | |
| 19 | |
| 20 sys.stdout.write(test_file + "..."); | |
| 21 status = os.system(cmd); | |
| 22 if status != 0: | |
| 23 fail_count += 1 | |
| 24 print('\033[1;31m[fail]\033[1;m') | |
| 25 failures.append(test_file) | |
| 26 else: | |
| 27 success_count += 1 | |
| 28 print('\033[1;32m[ok]\033[1;m') | |
| 29 | |
| 30 | |
| 31 verbose = False | |
| 32 | |
| 33 if len(sys.argv) > 1: | |
| 34 test_files = sys.argv[1:] | |
| 35 verbose = True | |
| 36 else: | |
| 37 test_files = glob.glob("./torture-s2wasm-sexpr-wasm/*.wasm") | |
| 38 | |
| 39 for test_file in test_files: | |
| 40 run_test(test_file, verbose) | |
| 41 | |
| 42 if len(failures) > 0: | |
| 43 print("Failures:") | |
| 44 for f in failures: | |
| 45 print(" \033[1;31m" + f + "\033[1;m") | |
| 46 print("{} / {} tests passed".format(success_count, success_count + fail_count)) | |
| OLD | NEW |