diff options
author | umarcor <unai.martinezcorral@ehu.eus> | 2021-06-19 11:20:12 +0200 |
---|---|---|
committer | umarcor <unai.martinezcorral@ehu.eus> | 2021-06-19 22:04:33 +0200 |
commit | 2033a3769eb75b7b8685385a8f0fe6597986d2fe (patch) | |
tree | 65df4bd54ec6fb17e31692a2a3665b7c9dc0a3c5 /testsuite | |
parent | ee05ac37d1a78c899f9d48dcd45ee22e5a00f892 (diff) | |
download | ghdl-2033a3769eb75b7b8685385a8f0fe6597986d2fe.tar.gz ghdl-2033a3769eb75b7b8685385a8f0fe6597986d2fe.tar.bz2 ghdl-2033a3769eb75b7b8685385a8f0fe6597986d2fe.zip |
testsuite/pyunit/dom: replace AllVHDLSources.sh with AllSources.py
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/pyunit/dom/AllSources.py | 23 | ||||
-rwxr-xr-x | testsuite/pyunit/dom/AllVHDLSources.sh | 31 |
2 files changed, 23 insertions, 31 deletions
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/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 |