metadata_lines = None
with open(metadata_filename, 'r') as metadata_file:
metadata_lines = metadata_file.readlines()
- metadata_content = ''.join(metadata_lines)
+
+ benchmark_content = None
+ if metadata_filename == benchmark_path:
+ benchmark_content = ''.join(metadata_lines)
+ else:
+ with open(benchmark_path, 'r') as benchmark_file:
+ benchmark_content = benchmark_file.read()
# Extract the metadata for the benchmark.
scrubber = None
if expected_output == '' and expected_error == '':
match = None
if status_regex:
- match = re.search(status_regex, metadata_content)
+ match = re.search(status_regex, benchmark_content)
if match:
expected_output = status_to_output(match.group(1))
# been set explicitly, the benchmark is invalid.
sys.exit('Cannot determine status of "{}"'.format(benchmark_path))
- if not proof and ('(get-unsat-core)' in metadata_content
- or '(get-unsat-assumptions)' in metadata_content):
+ if not proof and ('(get-unsat-core)' in benchmark_content
+ or '(get-unsat-assumptions)' in benchmark_content):
print(
'1..0 # Skipped: unsat cores not supported without proof support')
return