vvp_reg.py: Allow to omit empty gold files
vvp_reg.py requires 4 gold files. One for each of stdout and stderr of both iverilog and vvp. Most of these log files will be empty for most test cases. This will result in a lot of empty files being added to the repository. If a gold file for a specific output stream can not be found assume that the output stream is supposed to empty. This allows to omit the empty gold files. Also remove all the existing empty gold files. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
e9646bbbd3
commit
98a208d6be
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue