aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/pyunit
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-11-23 07:56:08 +0100
committerTristan Gingold <tgingold@free.fr>2022-11-23 07:56:08 +0100
commitd2a0fe9e9c097a5130a6d6a6f2c8c76bf4394ae0 (patch)
tree3aea731d1ada912ff5841d7e45d2dfa3425bfeb9 /testsuite/pyunit
parent877e9797d7efbc252e77ad05b9c99e18e555b03a (diff)
downloadghdl-d2a0fe9e9c097a5130a6d6a6f2c8c76bf4394ae0.tar.gz
ghdl-d2a0fe9e9c097a5130a6d6a6f2c8c76bf4394ae0.tar.bz2
ghdl-d2a0fe9e9c097a5130a6d6a6f2c8c76bf4394ae0.zip
testsuite/pyunit/libghdl: add tests for process comments
Diffstat (limited to 'testsuite/pyunit')
-rw-r--r--testsuite/pyunit/libghdl/Comments.py10
-rw-r--r--testsuite/pyunit/libghdl/process.vhdl9
-rw-r--r--testsuite/pyunit/libghdl/process_fail.vhdl9
3 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/pyunit/libghdl/Comments.py b/testsuite/pyunit/libghdl/Comments.py
index 7bdffba11..2c426a626 100644
--- a/testsuite/pyunit/libghdl/Comments.py
+++ b/testsuite/pyunit/libghdl/Comments.py
@@ -73,6 +73,9 @@ class Instantiate(TestCase):
k = nodes.Get_Kind(stmt)
if k in nodes.Iir_Kinds.Process_Statement:
self.checkDecls(nodes.Get_Declaration_Chain(stmt))
+ id = nodes.Get_Identifier(stmt)
+ if id != name_table.Null_Identifier:
+ self.checkComments(stmt, name_table.Get_Name_Ptr(id))
stmt = nodes.Get_Chain(stmt)
def checkFile(self, filename) -> None:
@@ -257,5 +260,12 @@ class Instantiate(TestCase):
def test_func_param(self) -> None:
self.checkFile(self._root / "func_param.vhdl")
+ @expectedFailure
+ def test_process_fail(self) -> None:
+ self.checkFile(self._root / "process_fail.vhdl")
+
+ def test_process(self) -> None:
+ self.checkFile(self._root / "process.vhdl")
+
# TODO: first comment
# Empty line before to easy cut & put
diff --git a/testsuite/pyunit/libghdl/process.vhdl b/testsuite/pyunit/libghdl/process.vhdl
new file mode 100644
index 000000000..c0b56fe6e
--- /dev/null
+++ b/testsuite/pyunit/libghdl/process.vhdl
@@ -0,0 +1,9 @@
+architecture arch of e is
+ signal s, s_n : bit;
+begin
+ -- Comment for :p:
+ p : process (s)
+ begin
+ s <= not s_n;
+ end process;
+end arch;
diff --git a/testsuite/pyunit/libghdl/process_fail.vhdl b/testsuite/pyunit/libghdl/process_fail.vhdl
new file mode 100644
index 000000000..819e5ea6e
--- /dev/null
+++ b/testsuite/pyunit/libghdl/process_fail.vhdl
@@ -0,0 +1,9 @@
+architecture arch of e is
+ signal s, s_n : bit;
+begin
+ -- Comment
+ p : process (s)
+ begin
+ s <= not s_n;
+ end process;
+end arch;