aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-19 22:38:49 +0200
committerGitHub <noreply@github.com>2021-06-19 22:38:49 +0200
commit603c44d06dd0b3f2f49af25045b46dd8aa72979a (patch)
treef36e6d79ccd0adb79af25fa67ef653b6d6ebd3f7
parente72d21499659f1bb4b641b9a83698354eb170eef (diff)
parente145bdc8124a2418f31e044d00cec51c98906dc7 (diff)
downloadghdl-603c44d06dd0b3f2f49af25045b46dd8aa72979a.tar.gz
ghdl-603c44d06dd0b3f2f49af25045b46dd8aa72979a.tar.bz2
ghdl-603c44d06dd0b3f2f49af25045b46dd8aa72979a.zip
Add unit tests for pyGHDL DOM
-rw-r--r--pyGHDL/requirements.txt2
-rw-r--r--testsuite/pyunit/dom/AllSources.py23
-rwxr-xr-xtestsuite/testsuite.sh2
3 files changed, 25 insertions, 2 deletions
diff --git a/pyGHDL/requirements.txt b/pyGHDL/requirements.txt
index 0b7708418..d8892cfae 100644
--- a/pyGHDL/requirements.txt
+++ b/pyGHDL/requirements.txt
@@ -1,2 +1,2 @@
pydecor>=2.0.1
-pyVHDLModel>=0.10.0
+pyVHDLModel>=0.10.1
diff --git a/testsuite/pyunit/dom/AllSources.py b/testsuite/pyunit/dom/AllSources.py
new file mode 100644
index 000000000..645394742
--- /dev/null
+++ b/testsuite/pyunit/dom/AllSources.py
@@ -0,0 +1,23 @@
+from sys import executable
+from subprocess import check_call, STDOUT
+from pathlib import Path
+from glob import glob
+from pytest import mark
+
+if __name__ == "__main__":
+ print("ERROR: you called a testcase declaration file as an executable module.")
+ print("Use: 'python -m unitest <testcase module>'")
+ exit(1)
+
+
+@mark.parametrize(
+ "file",
+ glob(str(Path(__file__).resolve().parent.parent.parent.parent / '**' / '*.vhdl'), recursive=True)
+)
+@mark.xfail
+def test_AllVHDLSources(file):
+ check_call([
+ executable,
+ str(Path(__file__).resolve().parent.parent.parent.parent / 'pyGHDL' / 'cli' / 'DOM.py'),
+ file
+ ], stderr=STDOUT)
diff --git a/testsuite/testsuite.sh b/testsuite/testsuite.sh
index 8026af974..3408c2f4f 100755
--- a/testsuite/testsuite.sh
+++ b/testsuite/testsuite.sh
@@ -130,7 +130,7 @@ do_test() {
pyunit)
# The Python Unit testsuite: regression testsuite for Python bindings to libghdl
gstart "[GHDL - test] pyunit"
- PYTHONPATH=$(pwd)/.. ${PYTHON:-python3} -m pytest -rA pyunit
+ PYTHONPATH=$(pwd)/.. ${PYTHON:-python3} -m pytest -vsrA pyunit
gend
;;