From ea72eb4f0703b16e935dc6f41f54bc94739a18f3 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 17 May 2022 21:14:58 +0200 Subject: Fixed failing sanity checks for pyGHDL.dom in coverage job. --- testsuite/pyunit/dom/Sanity.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'testsuite') diff --git a/testsuite/pyunit/dom/Sanity.py b/testsuite/pyunit/dom/Sanity.py index cc321acc7..0d84687ba 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 @@ -46,10 +46,9 @@ if __name__ == "__main__": _TESTSUITE_ROOT = Path(__file__).parent.parent.parent.resolve() _GHDL_ROOT = _TESTSUITE_ROOT.parent +# design = Design() -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(_GHDL_ROOT)) for f in _TESTSUITE_ROOT.glob("sanity/**/*.vhdl")]) def test_AllVHDLSources(file): check_call([sys_executable, _GHDL_ROOT / "pyGHDL/cli/dom.py", "pretty", "-f", file], stderr=STDOUT) -- cgit v1.2.3 From c634df29a8ccd593f07f5e67625c556eff3a5345 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sat, 18 Jun 2022 23:48:24 +0200 Subject: Checking if all other stuff is working without sanity checks. --- testsuite/pyunit/dom/Sanity.py | 1 + 1 file changed, 1 insertion(+) (limited to 'testsuite') diff --git a/testsuite/pyunit/dom/Sanity.py b/testsuite/pyunit/dom/Sanity.py index 0d84687ba..6ac4bea25 100644 --- a/testsuite/pyunit/dom/Sanity.py +++ b/testsuite/pyunit/dom/Sanity.py @@ -48,6 +48,7 @@ _GHDL_ROOT = _TESTSUITE_ROOT.parent # design = Design() +@mark.xfail(reason="Was it every working?") @mark.parametrize("file", [str(f.relative_to(_GHDL_ROOT)) for f in _TESTSUITE_ROOT.glob("sanity/**/*.vhdl")]) def test_AllVHDLSources(file): check_call([sys_executable, _GHDL_ROOT / "pyGHDL/cli/dom.py", "pretty", "-f", file], stderr=STDOUT) -- cgit v1.2.3 From 2387eff54cb72997fb9afd30a2ea0754264deb3b Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 19 Jun 2022 20:49:03 +0200 Subject: Enabled AMS support for all VHDL files. Added more [NOT IMPLEMENTED] rules to support VHDL-AMS code. --- testsuite/pyunit/dom/Sanity.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'testsuite') diff --git a/testsuite/pyunit/dom/Sanity.py b/testsuite/pyunit/dom/Sanity.py index 6ac4bea25..5e932322d 100644 --- a/testsuite/pyunit/dom/Sanity.py +++ b/testsuite/pyunit/dom/Sanity.py @@ -31,31 +31,27 @@ # 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 '") exit(1) + _TESTSUITE_ROOT = Path(__file__).parent.parent.parent.resolve() _GHDL_ROOT = _TESTSUITE_ROOT.parent -# design = Design() -@mark.xfail(reason="Was it every working?") +design = Design() + + @mark.parametrize("file", [str(f.relative_to(_GHDL_ROOT)) for f in _TESTSUITE_ROOT.glob("sanity/**/*.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) + lib = design.GetLibrary("sanity") + document = Document(Path(file)) + design.AddDocument(document, lib) -- cgit v1.2.3 From 24f4de4220f3635afc8c4334c5805e874329e396 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 19 Jun 2022 21:06:11 +0200 Subject: Made paths relative, so it can be launched from testsuits directory too. --- testsuite/pyunit/dom/Sanity.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'testsuite') diff --git a/testsuite/pyunit/dom/Sanity.py b/testsuite/pyunit/dom/Sanity.py index 5e932322d..ff5151fb3 100644 --- a/testsuite/pyunit/dom/Sanity.py +++ b/testsuite/pyunit/dom/Sanity.py @@ -44,14 +44,16 @@ if __name__ == "__main__": _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(_GHDL_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): + filePath = _TESTSUITE_ROOT / file + lib = design.GetLibrary("sanity") - document = Document(Path(file)) + document = Document(filePath) design.AddDocument(document, lib) -- cgit v1.2.3