Speed up the spec case test by parallelism (#819)

Port spec-test-script/all.sh to spec-test-script/all.py and enable to run
spec cases with multiple threads parallelly:
- It reduces spec_test.yml from ~14min to ~9min and reduces
  compilation_on_sgx.yml from ~18min to ~12min
- run `./test_wamr.sh` will keep the same experience likes before by default
- run `./test_wamr.sh -P` will enable parallelism mode
- in parallelism mode, all.py will be in a less-output mode. It only outputs
  the last words of failed cases and will not output logs for those passed
This commit is contained in:
liang.he
2021-11-08 12:39:02 +08:00
committed by GitHub
parent 403a7d3f4f
commit 487072a78e
5 changed files with 461 additions and 20 deletions

View File

@ -1075,6 +1075,7 @@ if __name__ == "__main__":
if test_aot:
(t3fd, aot_tempfile) = tempfile.mkstemp(suffix=".aot")
ret_code = 0
try:
log("################################################")
log("### Testing %s" % opts.test_file.name)
@ -1262,9 +1263,10 @@ if __name__ == "__main__":
raise Exception("unrecognized form '%s...'" % form[0:40])
except Exception as e:
traceback.print_exc()
raise Exception("catch an exception {}".format(e))
print("THE FINAL EXCEPTION IS {}".format(e))
ret_code = 101
else:
sys.exit(0)
ret_code = 0
finally:
if not opts.no_cleanup:
log("Removing tempfiles")
@ -1285,3 +1287,5 @@ if __name__ == "__main__":
log("### End testing %s" % opts.test_file.name)
else:
log("Leaving tempfiles: %s" % ([wast_tempfile, wasm_tempfile]))
sys.exit(ret_code)