aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2020-12-27 23:52:09 +0100
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2020-12-27 23:52:09 +0100
commitc4426fcb59e5dd1faef2900581966a199a592bf1 (patch)
treedfc72281d8a8cd462ddb00e9015b9ce9cb2a8f66 /testsuite
parent6380738fb2056dac397fb5ae09ca644b4cd770fb (diff)
downloadghdl-c4426fcb59e5dd1faef2900581966a199a592bf1.tar.gz
ghdl-c4426fcb59e5dd1faef2900581966a199a592bf1.tar.bz2
ghdl-c4426fcb59e5dd1faef2900581966a199a592bf1.zip
Added structure for unit tests for Python code.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/pyunit/dom/Instantiate.py24
-rw-r--r--testsuite/pyunit/libghdl/Initialize.py20
2 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/pyunit/dom/Instantiate.py b/testsuite/pyunit/dom/Instantiate.py
new file mode 100644
index 000000000..c3509e39b
--- /dev/null
+++ b/testsuite/pyunit/dom/Instantiate.py
@@ -0,0 +1,24 @@
+from pathlib import Path
+from unittest import TestCase
+
+from pyVHDLModel.VHDLModel import Design, Library, Document, Entity
+
+
+if __name__ == "__main__":
+ print("ERROR: you called a testcase declaration file as an executable module.")
+ print("Use: 'python -m unitest <testcase module>'")
+ exit(1)
+
+class Instantiate(TestCase):
+ def test_Design(self):
+ design = Design()
+
+ def test_Library(self):
+ library = Library()
+
+ def test_Document(self):
+ path = Path("tests.vhdl")
+ document = Document(path)
+
+ def test_Entity(self):
+ entity = Entity("entity_1")
diff --git a/testsuite/pyunit/libghdl/Initialize.py b/testsuite/pyunit/libghdl/Initialize.py
new file mode 100644
index 000000000..b7e370650
--- /dev/null
+++ b/testsuite/pyunit/libghdl/Initialize.py
@@ -0,0 +1,20 @@
+from unittest import TestCase
+
+
+if __name__ == "__main__":
+ print("ERROR: you called a testcase declaration file as an executable module.")
+ print("Use: 'python -m unitest <testcase module>'")
+ exit(1)
+
+class Instantiate(TestCase):
+ def test_InitializeGHDL(self):
+ pass
+
+ def test_ReadSourceFile(self):
+ pass
+
+ def test_ParseFile(self):
+ pass
+
+ def test_ListDesignUnits(self):
+ pass