Fixed crash when fauly inputfile was given
from benchexec.model import Run
from benchexec import result
import json
+import os
+import logging
class P4SetupHandler(object):
"""
@@ -13,10 +15,15 @@ class P4SetupHandler(object):
def update_runsets(self):
for runSet in self.benchmark.run_sets:
- #Divide the defined run into multiple run if necessery
+ #Divide the defined run into multiple run if necessery. Check len of runs: If 0, the setup went wrong.
+ if len(runSet.runs) > 0:
old_run = runSet.runs[0]
expected_result_filename = old_run.identifier
+ if os.path.exists(expected_result_filename):
expected_dict = self._read_expected_result_json(expected_result_filename)
+ else:
+ logging.info("Could not identify expected result file. Assuming all test is true.")
+ expected_dict = {}
prop = old_run.properties
runSet.runs = []
for module_name in self.test_dict:
