From a5ddd10e31b089637f1e85712f3cdef3bb6025d9 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Wed, 27 Jul 2022 10:45:33 +0100 Subject: [PATCH] Tests: compare VCD files both ways vcddiff is a bit broken, and sometimes 'vcddiff a b' fails while the files are indeed equivalent. There is a chance however that 'vcddif b a' will succeed in this case, so compare trace files both ways when checking test results and claim success if vcddiff succeeds in at least one direction. --- test_regress/driver.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test_regress/driver.pl b/test_regress/driver.pl index ae0ed4f36..22a2a67f8 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -2259,10 +2259,15 @@ sub vcd_identical { print "\t$cmd\n" if $::Debug; $out = `$cmd`; if ($? != 0 || $out ne '') { - print $out; - $self->error("VCD miscompares $fn1 $fn2\n"); - $self->copy_if_golden($fn1, $fn2); - return 0; + $cmd = qq{vcddiff "$fn2" "$fn1"}; + print "\t$cmd\n" if $::Debug; + $out = `$cmd`; + if ($? != 0 || $out ne '') { + print $out; + $self->error("VCD miscompares $fn2 $fn1\n"); + $self->copy_if_golden($fn1, $fn2); + return 0; + } } } {