diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-02-09 20:27:51 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-02-09 20:27:51 +0100 |
commit | 45dba464bc2f69145753e4c9c9b1dde0868ec878 (patch) | |
tree | 84ec4ab7344a59c26a175e299d57f594373068d4 /testsuite | |
parent | ae3865c0cbf1f71f7b8576031a37ac855060677b (diff) | |
download | ghdl-45dba464bc2f69145753e4c9c9b1dde0868ec878.tar.gz ghdl-45dba464bc2f69145753e4c9c9b1dde0868ec878.tar.bz2 ghdl-45dba464bc2f69145753e4c9c9b1dde0868ec878.zip |
testsuite: check feature before testing it.
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/gna/bug037/testsuite.sh | 4 | ||||
-rwxr-xr-x | testsuite/gna/bug05/testsuite.sh | 4 | ||||
-rwxr-xr-x | testsuite/gna/bug17309/testsuite.sh | 8 | ||||
-rwxr-xr-x | testsuite/gna/bug21052/testsuite.sh | 4 | ||||
-rwxr-xr-x | testsuite/gna/bug23165/testsuite.sh | 4 | ||||
-rwxr-xr-x | testsuite/gna/testsuite.sh | 3 | ||||
-rwxr-xr-x | testsuite/gna/ticket104/testsuite.sh | 3 | ||||
-rwxr-xr-x | testsuite/gna/ticket30/testsuite.sh | 8 | ||||
-rwxr-xr-x | testsuite/gna/ticket51/testsuite.sh | 4 | ||||
-rw-r--r-- | testsuite/gna/ticket90/test2.vhdl | 12 | ||||
-rwxr-xr-x | testsuite/gna/ticket90/testsuite.sh | 1 | ||||
-rw-r--r-- | testsuite/testenv.sh | 5 |
12 files changed, 49 insertions, 11 deletions
diff --git a/testsuite/gna/bug037/testsuite.sh b/testsuite/gna/bug037/testsuite.sh index 4b6af06b6..b5f21509e 100755 --- a/testsuite/gna/bug037/testsuite.sh +++ b/testsuite/gna/bug037/testsuite.sh @@ -3,7 +3,9 @@ . ../../testenv.sh analyze repro.vhdl -elab_simulate repro --dump-rti +if ghdl_has_feature repro dump-rti; then + elab_simulate repro --dump-rti +fi clean diff --git a/testsuite/gna/bug05/testsuite.sh b/testsuite/gna/bug05/testsuite.sh index 5343c9343..7f3c77360 100755 --- a/testsuite/gna/bug05/testsuite.sh +++ b/testsuite/gna/bug05/testsuite.sh @@ -7,7 +7,9 @@ elab tb if ghdl_has_feature tb fst; then simulate tb --fst=tb.fst fi -simulate tb --vcd=tb.vcd +if ghdl_has_feature tb vcd; then + simulate tb --vcd=tb.vcd +fi clean rm -f tb.fst tb.vcd diff --git a/testsuite/gna/bug17309/testsuite.sh b/testsuite/gna/bug17309/testsuite.sh index 689896329..c82fe6518 100755 --- a/testsuite/gna/bug17309/testsuite.sh +++ b/testsuite/gna/bug17309/testsuite.sh @@ -3,7 +3,13 @@ . ../../testenv.sh analyze polyamplib.vhdl master_testbench3.vhdl -elab_simulate master_testbench3 --stop-time=1ms +if ghdl_is_interpretation; then + stop=10us +else + stop=1ms +fi + +elab_simulate master_testbench3 --stop-time=$stop clean diff --git a/testsuite/gna/bug21052/testsuite.sh b/testsuite/gna/bug21052/testsuite.sh index 542440374..ba1ff83f4 100755 --- a/testsuite/gna/bug21052/testsuite.sh +++ b/testsuite/gna/bug21052/testsuite.sh @@ -3,7 +3,9 @@ . ../../testenv.sh analyze test.vhd -elab_simulate test --wave=test.ghw +if ghdl_has_feature test ghw; then + elab_simulate test --wave=test.ghw +fi clean diff --git a/testsuite/gna/bug23165/testsuite.sh b/testsuite/gna/bug23165/testsuite.sh index 66e03f0c6..5fdbeeef6 100755 --- a/testsuite/gna/bug23165/testsuite.sh +++ b/testsuite/gna/bug23165/testsuite.sh @@ -8,7 +8,9 @@ elab_simulate mwe --stop-time=100us analyze mwe_working/counter.vhd analyze mwe_working/mwe.vhd -elab_simulate mwe --stop-time=100us --wave=output.ghw +if ghdl_has_feature mwe ghw; then + elab_simulate mwe --stop-time=100us --wave=output.ghw +fi analyze mwe2/mwe.vhd elab_simulate mwe --stop-time=100us diff --git a/testsuite/gna/testsuite.sh b/testsuite/gna/testsuite.sh index 3e486f954..11431cd17 100755 --- a/testsuite/gna/testsuite.sh +++ b/testsuite/gna/testsuite.sh @@ -36,6 +36,9 @@ for i in $dirs; do echo "GNA dir $i:" cd $i if ! ./testsuite.sh; then + echo "#################################################################" + echo "######### FAILURE: $i" + echo "#################################################################" if [ $full = "y" ]; then failures="$failures $i" else diff --git a/testsuite/gna/ticket104/testsuite.sh b/testsuite/gna/ticket104/testsuite.sh index d0db007ca..6eb84c33e 100755 --- a/testsuite/gna/ticket104/testsuite.sh +++ b/testsuite/gna/ticket104/testsuite.sh @@ -3,7 +3,8 @@ . ../../testenv.sh analyze bug_tb.vhd -elab_simulate_failure bug_tb +# Use stop-time as a guard. +elab_simulate_failure bug_tb --stop-time=100ns clean diff --git a/testsuite/gna/ticket30/testsuite.sh b/testsuite/gna/ticket30/testsuite.sh index a8c89444f..0d33bb257 100755 --- a/testsuite/gna/ticket30/testsuite.sh +++ b/testsuite/gna/ticket30/testsuite.sh @@ -9,10 +9,12 @@ fi "$GHDL" -i lib_numeric_tb.vhd "$GHDL" -m numeric_tb -simulate numeric_tb --stop-time=10ns --wave=numeric_tb.ghw \ - --sdf=typ==lib_numeric_tb.sdf +if ghdl_has_feature numeric_tb ghw; then + simulate numeric_tb --stop-time=10ns --wave=numeric_tb.ghw \ + --sdf=typ==lib_numeric_tb.sdf +fi clean -rm numeric_tb.ghw +rm -f numeric_tb.ghw echo "Test successful" diff --git a/testsuite/gna/ticket51/testsuite.sh b/testsuite/gna/ticket51/testsuite.sh index 2eb6c9d1c..407c27f80 100755 --- a/testsuite/gna/ticket51/testsuite.sh +++ b/testsuite/gna/ticket51/testsuite.sh @@ -5,8 +5,8 @@ analyze ent.vhdl elab_simulate ent -if "$GHDL" -v | grep -q mcode; then - echo "-o not supported by mcode" +if "$GHDL" -v | egrep -q 'mcode|interpret'; then + echo "Option -o not supported by mcode/interpretation" else "$GHDL" --elab-run -o ent1 ent "$GHDL" --elab-run -o "$PWD/ent2" ent diff --git a/testsuite/gna/ticket90/test2.vhdl b/testsuite/gna/ticket90/test2.vhdl new file mode 100644 index 000000000..44b8ec447 --- /dev/null +++ b/testsuite/gna/ticket90/test2.vhdl @@ -0,0 +1,12 @@ +entity test is + generic ( + a, b : integer; + c : natural); +begin + assert (a = b) and ((b /= c) or not (a = c)) + report "a /= b" severity failure; +end entity; + +architecture a of test is +begin +end architecture; diff --git a/testsuite/gna/ticket90/testsuite.sh b/testsuite/gna/ticket90/testsuite.sh index d4f9881e9..20e1ba557 100755 --- a/testsuite/gna/ticket90/testsuite.sh +++ b/testsuite/gna/ticket90/testsuite.sh @@ -9,6 +9,7 @@ clean GHDL_STD_FLAGS=--std=08 analyze test.vhdl +analyze test2.vhdl clean echo "Test successful" diff --git a/testsuite/testenv.sh b/testsuite/testenv.sh index 21a681d26..9af5f115d 100644 --- a/testsuite/testenv.sh +++ b/testsuite/testenv.sh @@ -100,6 +100,11 @@ ghdl_has_feature () "$GHDL" -r $GHDL_STD_FLAGS $GHDL_FLAGS $1 --has-feature=$2 } +ghdl_is_interpretation () +{ + "$GHDL" --version | grep -q interpretation +} + # Run a program run () { |