test: benchmark script exits with error on any checker error

This commit is contained in:
Jędrzej Boczar 2020-01-31 15:16:37 +01:00
parent 1a517a308d
commit 811c73254b
1 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@
import os import os
import re import re
import sys
import argparse import argparse
import subprocess import subprocess
from collections import defaultdict, namedtuple from collections import defaultdict, namedtuple
@ -247,7 +248,16 @@ def run_benchmarks(configurations):
cmd_args = config.as_args() cmd_args = config.as_args()
print('{}: {}'.format(name, ' '.join(cmd_args))) print('{}: {}'.format(name, ' '.join(cmd_args)))
output = run_benchmark(cmd_args) output = run_benchmark(cmd_args)
# return raw outputs, not BenchmarkResult so that we can store them in a file
benchmarks.append((config, output)) benchmarks.append((config, output))
# exit if checker had any read error
result = BenchmarkResult(config, output)
if result.checker_errors != 0:
print('Error during benchmark "{}": checker_errors = {}'.format(
name, result.checker_errors), file=sys.stderr)
sys.exit(1)
return benchmarks return benchmarks