From c4426fcb59e5dd1faef2900581966a199a592bf1 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 27 Dec 2020 23:52:09 +0100 Subject: Added structure for unit tests for Python code. --- testsuite/pyunit/dom/Instantiate.py | 24 ++++++++++++++++++++++++ testsuite/pyunit/libghdl/Initialize.py | 20 ++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 testsuite/pyunit/dom/Instantiate.py create mode 100644 testsuite/pyunit/libghdl/Initialize.py (limited to 'testsuite') 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 '") + 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 '") + 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 -- cgit v1.2.3