aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorPatrick Lehmann <Paebbels@gmail.com>2022-06-19 21:40:35 +0200
committerGitHub <noreply@github.com>2022-06-19 21:40:35 +0200
commit4afeced94eba857e929e7eaa4ca2899db69be520 (patch)
treebbbe8e33a86ca21cd9ae68e0eb813c9bf2269cf1 /testsuite
parent6080383b327571d366d3ed69bcf3cd4257a20010 (diff)
parent24f4de4220f3635afc8c4334c5805e874329e396 (diff)
downloadghdl-4afeced94eba857e929e7eaa4ca2899db69be520.tar.gz
ghdl-4afeced94eba857e929e7eaa4ca2899db69be520.tar.bz2
ghdl-4afeced94eba857e929e7eaa4ca2899db69be520.zip
Bumped dependencies to support pyTooling ≥2.0.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/pyunit/dom/Sanity.py26
1 files changed, 12 insertions, 14 deletions
diff --git a/testsuite/pyunit/dom/Sanity.py b/testsuite/pyunit/dom/Sanity.py
index cc321acc7..ff5151fb3 100644
--- a/testsuite/pyunit/dom/Sanity.py
+++ b/testsuite/pyunit/dom/Sanity.py
@@ -13,7 +13,7 @@
#
# License:
# ============================================================================
-# Copyright (C) 2019-2021 Tristan Gingold
+# Copyright (C) 2019-2022 Tristan Gingold
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,31 +31,29 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# ============================================================================
from pathlib import Path
-from subprocess import check_call, STDOUT
-from sys import executable as sys_executable
from pytest import mark
-from pyGHDL.dom.NonStandard import Design
+from pyGHDL.dom.NonStandard import Design, Document
+
if __name__ == "__main__":
print("ERROR: you called a testcase declaration file as an executable module.")
print("Use: 'python -m unitest <testcase module>'")
exit(1)
+
_TESTSUITE_ROOT = Path(__file__).parent.parent.parent.resolve()
-_GHDL_ROOT = _TESTSUITE_ROOT.parent
+_SANITY_TESTS_ROOT = _TESTSUITE_ROOT / "sanity"
design = Design()
-@mark.parametrize("file", [str(f.relative_to(_TESTSUITE_ROOT)) for f in _TESTSUITE_ROOT.glob("sanity/**/*.vhdl")])
+
+@mark.parametrize("file", [str(f.relative_to(_TESTSUITE_ROOT)) for f in _SANITY_TESTS_ROOT.glob("**/*.vhdl")])
def test_AllVHDLSources(file):
- check_call([sys_executable, _GHDL_ROOT / "pyGHDL/cli/dom.py", "pretty", "-f", file], stderr=STDOUT)
-
- # try:
- # lib = design.GetLibrary("sanity")
- # document = Document(Path(file))
- # design.AddDocument(document, lib)
- # except DOMException as ex:
- # print(ex)
+ filePath = _TESTSUITE_ROOT / file
+
+ lib = design.GetLibrary("sanity")
+ document = Document(filePath)
+ design.AddDocument(document, lib)