Handle crashes during test

This commit is contained in:
Joscha 2022-12-06 20:03:25 +01:00
parent 5caa178c1c
commit c1fbf1eb5f

View file

@ -42,9 +42,16 @@ def main():
print(f"{GRAY}No solution{RESET} for {inputpath}") print(f"{GRAY}No solution{RESET} for {inputpath}")
continue continue
try:
resultstr = subprocess.run( resultstr = subprocess.run(
args.command + [inputpath], check=True, capture_output=True, text=True args.command + [inputpath],
check=True,
text=True,
capture_output=True,
).stdout ).stdout
except subprocess.CalledProcessError:
print(f"{RED}Crashed{RESET} on {inputpath}")
continue
if resultstr.strip() == solutionstr.strip(): if resultstr.strip() == solutionstr.strip():
print(f"{GREEN}Passed{RESET} {inputpath}") print(f"{GREEN}Passed{RESET} {inputpath}")