Add tests for `select` command warnings.
authorAlberto Gonzalez <boqwxp@airmail.cc>
Mon, 23 Mar 2020 06:13:48 +0000 (06:13 +0000)
committerAlberto Gonzalez <boqwxp@airmail.cc>
Mon, 23 Mar 2020 17:30:53 +0000 (17:30 +0000)
Makefile
tests/select/no_warn_prefixed_empty_select_arg.ys [new file with mode: 0644]
tests/select/run-test.sh [new file with mode: 0755]
tests/select/warn_empty_select_arg.ys [new file with mode: 0644]

index 49ab780d52e818f6cb05ddf529641f9fe6daae11..3c89fed20c38ebd67d6fa23f6325fbee2cbb665b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -716,6 +716,7 @@ test: $(TARGETS) $(EXTRA_TARGETS)
        +cd tests/memories && bash run-test.sh $(ABCOPT) $(SEEDOPT)
        +cd tests/bram && bash run-test.sh $(SEEDOPT)
        +cd tests/various && bash run-test.sh
+       +cd tests/select && bash run-test.sh
        +cd tests/sat && bash run-test.sh
        +cd tests/svinterfaces && bash run-test.sh $(SEEDOPT)
        +cd tests/svtypes && bash run-test.sh $(SEEDOPT)
diff --git a/tests/select/no_warn_prefixed_empty_select_arg.ys b/tests/select/no_warn_prefixed_empty_select_arg.ys
new file mode 100644 (file)
index 0000000..617e0d6
--- /dev/null
@@ -0,0 +1,3 @@
+logger -expect-no-warnings
+select n:foo/bar*
+select t:$assert
diff --git a/tests/select/run-test.sh b/tests/select/run-test.sh
new file mode 100755 (executable)
index 0000000..44ce7e6
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -e
+for x in *.ys; do
+  echo "Running $x.."
+  ../../yosys -ql ${x%.ys}.log $x
+done
diff --git a/tests/select/warn_empty_select_arg.ys b/tests/select/warn_empty_select_arg.ys
new file mode 100644 (file)
index 0000000..55aca8e
--- /dev/null
@@ -0,0 +1,3 @@
+logger -expect warning "did not match any module." 1
+logger -expect warning "did not match any object." 1
+select foo/bar