Merge pull request #881 from larsclausen/empty-gold

vvp_reg.py: Allow to omit empty gold files
This commit is contained in:
Stephen Williams 2023-03-12 18:00:57 -07:00 committed by GitHub
commit 0144168723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 7 additions and 2 deletions

View File

@ -90,8 +90,13 @@ def compare_files(log_path, gold_path):
with open(log_path, 'rt') as fd:
a = fd.readlines()
with open(gold_path, 'rt') as fd:
b = fd.readlines()
# Allow to omit empty gold files
if os.path.exists(gold_path):
with open(gold_path, 'rt') as fd:
b = fd.readlines()
else:
b = []
flag = a == b
if not flag: