Handle crashes during test
This commit is contained in:
parent
5caa178c1c
commit
c1fbf1eb5f
1 changed files with 10 additions and 3 deletions
13
test.py
13
test.py
|
|
@ -42,9 +42,16 @@ def main():
|
||||||
print(f"{GRAY}No solution{RESET} for {inputpath}")
|
print(f"{GRAY}No solution{RESET} for {inputpath}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
resultstr = subprocess.run(
|
try:
|
||||||
args.command + [inputpath], check=True, capture_output=True, text=True
|
resultstr = subprocess.run(
|
||||||
).stdout
|
args.command + [inputpath],
|
||||||
|
check=True,
|
||||||
|
text=True,
|
||||||
|
capture_output=True,
|
||||||
|
).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}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue