Setup tests/verilog properly
authorEddie Hung <eddie@fpgeh.com>
Mon, 11 May 2020 17:30:20 +0000 (10:30 -0700)
committerEddie Hung <eddie@fpgeh.com>
Mon, 11 May 2020 17:31:02 +0000 (10:31 -0700)
Makefile
tests/verilog/.gitignore [new file with mode: 0644]
tests/verilog/run-test.sh [new file with mode: 0755]

index a481dd92b544b5c7bcf118651aa3ac8acbf5ac97..cd6179879fec1a7bba31e75bd906b63446672016 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -780,6 +780,7 @@ test: $(TARGETS) $(EXTRA_TARGETS)
        +cd tests/arch/intel_alm && bash run-test.sh $(SEEDOPT)
        +cd tests/rpc && bash run-test.sh
        +cd tests/memfile && bash run-test.sh
+       +cd tests/verilog && bash run-test.sh
        @echo ""
        @echo "  Passed \"make test\"."
        @echo ""
diff --git a/tests/verilog/.gitignore b/tests/verilog/.gitignore
new file mode 100644 (file)
index 0000000..b48f808
--- /dev/null
@@ -0,0 +1,3 @@
+/*.log
+/*.out
+/run-test.mk
diff --git a/tests/verilog/run-test.sh b/tests/verilog/run-test.sh
new file mode 100755 (executable)
index 0000000..ea56b70
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+set -e
+{
+echo "all::"
+for x in *.ys; do
+       echo "all:: run-$x"
+       echo "run-$x:"
+       echo "  @echo 'Running $x..'"
+       echo "  @../../yosys -ql ${x%.ys}.log $x"
+done
+for s in *.sh; do
+       if [ "$s" != "run-test.sh" ]; then
+               echo "all:: run-$s"
+               echo "run-$s:"
+               echo "  @echo 'Running $s..'"
+               echo "  @bash $s"
+       fi
+done
+} > run-test.mk
+exec ${MAKE:-make} -f run-test.mk