Handle timeout in runtests
This commit is contained in:
parent
4aed15540d
commit
7702c44288
|
@ -50,14 +50,19 @@ for test in testlist:
|
||||||
if generate_vcd:
|
if generate_vcd:
|
||||||
cmdline += ["--vcd", f"tmp/{test}.vcd"]
|
cmdline += ["--vcd", f"tmp/{test}.vcd"]
|
||||||
|
|
||||||
test_run_ret = subprocess.run(
|
try:
|
||||||
cmdline,
|
test_run_ret = subprocess.run(
|
||||||
stdout = subprocess.PIPE,
|
cmdline,
|
||||||
stderr = subprocess.PIPE,
|
stdout = subprocess.PIPE,
|
||||||
timeout=10
|
stderr = subprocess.PIPE,
|
||||||
)
|
timeout=10
|
||||||
with open(f"tmp/{test}.log", "wb") as f:
|
)
|
||||||
f.write(test_run_ret.stdout)
|
with open(f"tmp/{test}.log", "wb") as f:
|
||||||
|
f.write(test_run_ret.stdout)
|
||||||
|
except subprocess.TimeoutExpired:
|
||||||
|
print("\033[31m[TIMOUT]\033[39m")
|
||||||
|
all_passed = False
|
||||||
|
continue
|
||||||
|
|
||||||
# Testbench itself should always exit successfully.
|
# Testbench itself should always exit successfully.
|
||||||
if test_run_ret.returncode != 0:
|
if test_run_ret.returncode != 0:
|
||||||
|
|
Loading…
Reference in New Issue