Set aside extraneous tests in simple_abc9 test suite
authorZachary Snow <zach@zachjs.com>
Wed, 10 Feb 2021 00:58:15 +0000 (19:58 -0500)
committerZachary Snow <zachary.j.snow@gmail.com>
Mon, 1 Mar 2021 17:13:11 +0000 (12:13 -0500)
New test cases on one branch may be automatically copied from simple/ to
simple_abc9/, causing failures when switching to another branch. This
updates the simple_abc9 script to set aside extraneous tests in a
non-destructive way.

tests/simple_abc9/.gitignore
tests/simple_abc9/run-test.sh

index 2355aea295308af651df8d5e02d58fa44f307dd5..fda60e577856e7ae8d03a4e5b25d0c427f6be500 100644 (file)
@@ -2,3 +2,4 @@
 *.sv
 *.log
 *.out
+*.bak
index 650e42fcab8f79fe2b9c074b2248196ef213eae5..b48505e29adc8b4bba4f433ccd3ab606bce4652c 100755 (executable)
@@ -17,6 +17,24 @@ if ! command -v iverilog > /dev/null ; then
   exit 1
 fi
 
+for file in `ls *.v *.sv`; do
+    if [ ! -f "../simple/$file" -a "$file" != "abc9.v" ]; then
+       echo "Warning: $file is in simple_abc9/, but not in simple/"
+       backup="$file.bak"
+       if [ -f "$backup" ]; then
+           if cmp "$file" "$backup" > /dev/null; then
+               echo " => $backup already exists and matches; removing $file"
+               rm "$file"
+           else
+               echo " => $backup already exists but differs; leaving $file in place"
+           fi
+       else
+           echo " => moving $file to $backup"
+           mv -i "$file" "$backup"
+       fi
+    fi
+done
+
 cp ../simple/*.v .
 cp ../simple/*.sv .
 DOLLAR='?'