From 1b333d49ef0144d6f440b1c6cc57a6a6e2d4a1de Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Mon, 23 Mar 2020 06:13:48 +0000 Subject: Add tests for `select` command warnings. --- tests/select/no_warn_prefixed_empty_select_arg.ys | 3 +++ tests/select/run-test.sh | 6 ++++++ tests/select/warn_empty_select_arg.ys | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 tests/select/no_warn_prefixed_empty_select_arg.ys create mode 100755 tests/select/run-test.sh create mode 100644 tests/select/warn_empty_select_arg.ys (limited to 'tests') 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 index 000000000..617e0d63e --- /dev/null +++ b/tests/select/no_warn_prefixed_empty_select_arg.ys @@ -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 index 000000000..44ce7e674 --- /dev/null +++ b/tests/select/run-test.sh @@ -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 index 000000000..55aca8eb6 --- /dev/null +++ b/tests/select/warn_empty_select_arg.ys @@ -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 -- cgit v1.2.3 From ca4e5dd56e1f007fa13c791ab179236103187c6f Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Mon, 23 Mar 2020 06:31:41 +0000 Subject: Suppress warnings for empty `select` arguments when `-count` or `-assert-*` options are set. --- tests/select/no_warn_assert.ys | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/select/no_warn_assert.ys (limited to 'tests') diff --git a/tests/select/no_warn_assert.ys b/tests/select/no_warn_assert.ys new file mode 100644 index 000000000..889315826 --- /dev/null +++ b/tests/select/no_warn_assert.ys @@ -0,0 +1,2 @@ +logger -expect-no-warnings +select -assert-count 0 top/t:ff4 top/w:d0 %co:+[d] %i -- cgit v1.2.3 From 0da65d498b9f18ce0c09eedc19f16db2390e6dcb Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Mon, 23 Mar 2020 17:50:11 +0000 Subject: Do not warn on empty selection with prefixed `arg_memb`. Co-Authored-By: N. Engelhardt --- tests/select/no_warn_prefixed_arg_memb.ys | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/select/no_warn_prefixed_arg_memb.ys (limited to 'tests') diff --git a/tests/select/no_warn_prefixed_arg_memb.ys b/tests/select/no_warn_prefixed_arg_memb.ys new file mode 100644 index 000000000..596a6ed70 --- /dev/null +++ b/tests/select/no_warn_prefixed_arg_memb.ys @@ -0,0 +1,5 @@ +logger -expect-no-warnings +read_verilog ../../examples/igloo2/example.v +hierarchy +proc +select example/t:$add -- cgit v1.2.3