From 450483c01607d3032d65e9a7dd9d3f3215697b72 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 9 Jan 2021 08:39:55 +0100 Subject: testsuite/gna: add a test for fmt command --- testsuite/gna/bug0120/print1.ref | 25 +++++++++++++++++++++++++ testsuite/gna/bug0120/print1.vhdl | 25 +++++++++++++++++++++++++ testsuite/gna/bug0120/print2.ref | 1 + testsuite/gna/bug0120/testsuite.sh | 11 +++++++++++ 4 files changed, 62 insertions(+) create mode 100644 testsuite/gna/bug0120/print1.ref create mode 100644 testsuite/gna/bug0120/print1.vhdl create mode 100644 testsuite/gna/bug0120/print2.ref create mode 100755 testsuite/gna/bug0120/testsuite.sh (limited to 'testsuite/gna/bug0120') diff --git a/testsuite/gna/bug0120/print1.ref b/testsuite/gna/bug0120/print1.ref new file mode 100644 index 000000000..6a16467fe --- /dev/null +++ b/testsuite/gna/bug0120/print1.ref @@ -0,0 +1,25 @@ +entity print1 is +end; + +architecture behav of print1 is + -- Check comment 1 + -- Check comment 2 + + -- Check long declaration indentation + constant bv1: bit_vector := + "0010001"; + constant bv2: bit_vector := x"af"; + -- Trailing comment +begin + /* A long comment + for vhdl 08 + */ + + process + begin + if (true /= false) + then + report "OK"; + end if; + end process; +end behav; diff --git a/testsuite/gna/bug0120/print1.vhdl b/testsuite/gna/bug0120/print1.vhdl new file mode 100644 index 000000000..39e74c973 --- /dev/null +++ b/testsuite/gna/bug0120/print1.vhdl @@ -0,0 +1,25 @@ +entity print1 is +end; + +architecture behav of print1 is + -- Check comment 1 + -- Check comment 2 + + -- Check long declaration indentation + constant bv1 : bit_vector := + "0010001"; +constant bv2 : bit_vector := x"af"; + -- Trailing comment +begin + /* A long comment + for vhdl 08 + */ + + process + begin + if(true/=false) + then + report "OK"; + end if; + end process; +end behav; diff --git a/testsuite/gna/bug0120/print2.ref b/testsuite/gna/bug0120/print2.ref new file mode 100644 index 000000000..16f27b1a6 --- /dev/null +++ b/testsuite/gna/bug0120/print2.ref @@ -0,0 +1 @@ + "0010001"; diff --git a/testsuite/gna/bug0120/testsuite.sh b/testsuite/gna/bug0120/testsuite.sh new file mode 100755 index 000000000..dc4eed9b0 --- /dev/null +++ b/testsuite/gna/bug0120/testsuite.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +. ../../testenv.sh + +$GHDL fmt --std=08 --level=space print1.vhdl > print1.out +diff --strip-trailing-cr print1.ref print1.out + +$GHDL fmt --std=08 --range=10:10 print1.vhdl > print2.out +diff --strip-trailing-cr print2.ref print2.out + +echo "Test successful" -- cgit v1.2.3