aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/gna/README3
-rwxr-xr-xtestsuite/gna/issue1323/testsuite.sh20
-rw-r--r--testsuite/testenv.sh12
3 files changed, 19 insertions, 16 deletions
diff --git a/testsuite/gna/README b/testsuite/gna/README
index 58f99572e..d5af291ac 100644
--- a/testsuite/gna/README
+++ b/testsuite/gna/README
@@ -47,6 +47,7 @@ you should test if the feature is supported. From issue158:
--------------------------------------------------
if ghdl_has_feature repro ghw; then
simulate repro --wave=repro.ghw
- # How to test the ghw ? Use ghwdump ?
+ ghw_diff repro
+ rm -f repro.txt repro.ghw
fi
--------------------------------------------------
diff --git a/testsuite/gna/issue1323/testsuite.sh b/testsuite/gna/issue1323/testsuite.sh
index c9c7091e1..2cc9ca2c9 100755
--- a/testsuite/gna/issue1323/testsuite.sh
+++ b/testsuite/gna/issue1323/testsuite.sh
@@ -4,22 +4,12 @@
analyze mydesign.vhdl
elab myentity
-
-simulate myentity --wave=dump.ghw | tee mydesign.out
-
-gcc ../../../src/grt/ghwdump.c ../../../src/grt/ghwlib.c -I../../../src/grt/ -o ghwdump
-
-# We're just checking that ghwdump doesn't crash on a zero length signal.
-./ghwdump -ths dump.ghw > dump.txt
-
-if diff --strip-trailing-cr dump.txt golden_dump.txt; then
- echo "The ghw dump matches."
-else
- echo "The ghw dump does not match what is expected."
- exit 1
+if ghdl_has_feature myentity ghw; then
+ elab_simulate myentity --wave=dump.ghw | tee mydesign.out
+ ghw_diff dump
+ rm -f mydesign.out dump.txt dump.ghw
fi
-#rm -f mydesign.out ghwdump dump.txt dump.ghw
clean
-echo "Test Success"
+echo "Test successful"
diff --git a/testsuite/testenv.sh b/testsuite/testenv.sh
index a8097eb11..7db202097 100644
--- a/testsuite/testenv.sh
+++ b/testsuite/testenv.sh
@@ -103,6 +103,18 @@ elab_simulate_failure ()
"$GHDL" --elab-run $GHDL_STD_FLAGS $GHDL_FLAGS $@ --expect-failure
}
+# Compare the dump of a GHW wave and a previous golden dump
+ghw_diff ()
+{
+ ghwdump -ths "$1".ghw > "$1".txt
+ if diff --strip-trailing-cr "$1".txt golden_"$1".txt; then
+ echo "The ghw dump matches."
+ else
+ echo "The ghw dump does not match what is expected."
+ exit 1
+ fi
+}
+
synth()
{
echo "Synthesis of $@" >&2