diff --git a/tests/mypy.sh b/tests/mypy.sh index af0cb055ae305f6dab9dd8896ab572d6f0c97af9..76d73b27ada3cc3675938359b7393238512b1d7f 100755 --- a/tests/mypy.sh +++ b/tests/mypy.sh @@ -28,20 +28,19 @@ set -u if [ -z "${G_TEST_SRCDIR-}" ]; then me="$(readlink -f "$0")" - srcdir="${me%/*}" - G_TEST_SRCDIR="${srcdir%/*}" + G_TEST_SRCDIR="${me%/*}" fi -cd "$G_TEST_SRCDIR" +cd "$G_TEST_SRCDIR/.." export MYPYPATH="${PYTHONPATH:="$(pwd)"}" i=0 for script in \ - "${G_TEST_SRCDIR}"/*.py \ - "${G_TEST_SRCDIR}"/pressure-vessel-test-ui \ - "${G_TEST_SRCDIR}"/sysroot/*.py \ - "${G_TEST_SRCDIR}"/tests/*.py \ + ./*.py \ + ./pressure-vessel-test-ui \ + ./sysroot/*.py \ + ./tests/*.py \ ; do i=$((i + 1)) if [ "x${MYPY:="$(command -v mypy || echo false)"}" = xfalse ]; then diff --git a/tests/pycodestyle.sh b/tests/pycodestyle.sh index cd33d6bf49fb9ed5fde892fb4d18fabfe05fb72c..2e3b6146cd586a527ceb036ae0098036beb8b762 100755 --- a/tests/pycodestyle.sh +++ b/tests/pycodestyle.sh @@ -28,11 +28,10 @@ set -u if [ -z "${G_TEST_SRCDIR-}" ]; then me="$(readlink -f "$0")" - srcdir="${me%/*}" - G_TEST_SRCDIR="${srcdir%/*}" + G_TEST_SRCDIR="${me%/*}" fi -cd "$G_TEST_SRCDIR" +cd "$G_TEST_SRCDIR/.." if [ "x${PYCODESTYLE:=pycodestyle}" = xfalse ] || \ [ -z "$(command -v "$PYCODESTYLE")" ]; then @@ -48,10 +47,10 @@ echo "1..1" if "${PYCODESTYLE}" \ --ignore=E402,W503 \ - "$G_TEST_SRCDIR"/*.py \ - "${G_TEST_SRCDIR}"/pressure-vessel-test-ui \ - "${G_TEST_SRCDIR}"/sysroot/*.py \ - "${G_TEST_SRCDIR}"/tests/*.py \ + ./*.py \ + ./pressure-vessel-test-ui \ + ./sysroot/*.py \ + ./tests/*.py \ >&2; then echo "ok 1 - $PYCODESTYLE reported no issues" else diff --git a/tests/pyflakes.sh b/tests/pyflakes.sh index 8da6f8dd7680e27f4284b19a399a0fca8a92203d..5511bfa24b14ca28d8dbd2ecc88aa8a016f4e32d 100755 --- a/tests/pyflakes.sh +++ b/tests/pyflakes.sh @@ -28,20 +28,19 @@ set -u if [ -z "${G_TEST_SRCDIR-}" ]; then me="$(readlink -f "$0")" - srcdir="${me%/*}" - G_TEST_SRCDIR="${srcdir%/*}" + G_TEST_SRCDIR="${me%/*}" fi -cd "$G_TEST_SRCDIR" +cd "$G_TEST_SRCDIR/.." if [ "x${PYFLAKES:=pyflakes3}" = xfalse ] || \ [ -z "$(command -v "$PYFLAKES")" ]; then echo "1..0 # SKIP pyflakes3 not found" elif "${PYFLAKES}" \ - "${G_TEST_SRCDIR}"/*.py \ - "${G_TEST_SRCDIR}"/pressure-vessel-test-ui \ - "${G_TEST_SRCDIR}"/sysroot/*.py \ - "${G_TEST_SRCDIR}"/tests/*.py \ + ./*.py \ + ./pressure-vessel-test-ui \ + ./sysroot/*.py \ + ./tests/*.py \ >&2; then echo "1..1" echo "ok 1 - $PYFLAKES reported no issues" diff --git a/tests/relocatable-install.py b/tests/relocatable-install.py index 04897a36881bdee858d61d283fddde5340126d75..2829b243da38dfd85112920ad89c7d9df8b60345 100755 --- a/tests/relocatable-install.py +++ b/tests/relocatable-install.py @@ -122,8 +122,10 @@ def check_dependencies(test, relocatable_install, path, is_wrapper=False): stdout=subprocess.PIPE, universal_newlines=True, ) + stdout = subproc.stdout + assert stdout is not None # for mypy - for line in subproc.stdout: + for line in stdout: line = line.strip() if ( diff --git a/tests/shellcheck.sh b/tests/shellcheck.sh index 85dbaff91d12c20b8982bc0b632ae9db276d2cf3..f952e51278e76623bb1e09865192c167d4fcec8e 100755 --- a/tests/shellcheck.sh +++ b/tests/shellcheck.sh @@ -28,19 +28,18 @@ fi if [ -z "${G_TEST_SRCDIR-}" ]; then me="$(readlink -f "$0")" - srcdir="${me%/*}" - G_TEST_SRCDIR="${srcdir%/*}" + G_TEST_SRCDIR="${me%/*}" fi -cd "$G_TEST_SRCDIR" +cd "$G_TEST_SRCDIR/.." n=0 for shell_script in \ - pressure-vessel-unruntime \ - pressure-vessel-unruntime-scout \ - pressure-vessel-unruntime-test-ui \ - pressure-vessel-locale-gen \ - tests/*.sh \ + ./pressure-vessel-unruntime \ + ./pressure-vessel-unruntime-scout \ + ./pressure-vessel-unruntime-test-ui \ + ./pressure-vessel-locale-gen \ + ./tests/*.sh \ ; do n=$((n + 1))