From 512422696869fb5615f91cface74a634eb14ff54 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 19 Jun 2021 15:52:54 +0200 Subject: testsuite/pyunit: add AllVHDLSources.sh --- testsuite/pyunit/dom/AllVHDLSources.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 testsuite/pyunit/dom/AllVHDLSources.sh (limited to 'testsuite') diff --git a/testsuite/pyunit/dom/AllVHDLSources.sh b/testsuite/pyunit/dom/AllVHDLSources.sh new file mode 100755 index 000000000..251b34163 --- /dev/null +++ b/testsuite/pyunit/dom/AllVHDLSources.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +cd $(dirname "$0")/../../.. + +gstart () { + printf "\e[36m> $@\e[0m\n" +} +gend () { + printf "$@\n" +} + +if [ -n "$CI" ]; then + gstart () { + printf '::group::' + printf "$@\n" + SECONDS=0 + } + + gend () { + duration=$SECONDS + echo '::endgroup::' + printf "$@\n" + } +fi + +for item in $(find ./ -type f -name "*.vhdl"); do + gstart "$item" + ./pyGHDL/cli/DOM.py $item \ + && gend '\e[32mpass\e[0m' \ + || gend '\e[31mfail\e[0m' +done -- cgit v1.2.3 From 2033a3769eb75b7b8685385a8f0fe6597986d2fe Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 19 Jun 2021 11:20:12 +0200 Subject: testsuite/pyunit/dom: replace AllVHDLSources.sh with AllSources.py --- testsuite/pyunit/dom/AllSources.py | 23 +++++++++++++++++++++++ testsuite/pyunit/dom/AllVHDLSources.sh | 31 ------------------------------- 2 files changed, 23 insertions(+), 31 deletions(-) create mode 100644 testsuite/pyunit/dom/AllSources.py delete mode 100755 testsuite/pyunit/dom/AllVHDLSources.sh (limited to 'testsuite') 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 '") + 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/pyunit/dom/AllVHDLSources.sh b/testsuite/pyunit/dom/AllVHDLSources.sh deleted file mode 100755 index 251b34163..000000000 --- a/testsuite/pyunit/dom/AllVHDLSources.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -cd $(dirname "$0")/../../.. - -gstart () { - printf "\e[36m> $@\e[0m\n" -} -gend () { - printf "$@\n" -} - -if [ -n "$CI" ]; then - gstart () { - printf '::group::' - printf "$@\n" - SECONDS=0 - } - - gend () { - duration=$SECONDS - echo '::endgroup::' - printf "$@\n" - } -fi - -for item in $(find ./ -type f -name "*.vhdl"); do - gstart "$item" - ./pyGHDL/cli/DOM.py $item \ - && gend '\e[32mpass\e[0m' \ - || gend '\e[31mfail\e[0m' -done -- cgit v1.2.3 From 4416285107eb5d59768ed29692cabdc684e407f5 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 19 Jun 2021 21:42:24 +0200 Subject: testsuite/pyunit: add opts '-vs' to pytest call --- testsuite/testsuite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite') 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 ;; -- cgit v1.2.3