Skip to content
Snippets Groups Projects
Commit a01eb723 authored by Simon McVittie's avatar Simon McVittie
Browse files

tests: Adjust QA checks for per-directory meson.build


Now that G_TEST_SRCDIR is what Autotools would call
"${top_srcdir}/tests/", we need to look one level up for the root of
the source tree.

Fixes: 09925ab2 "build: Split into subdirectories"
Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 008d38ed
No related branches found
No related tags found
No related merge requests found
...@@ -28,20 +28,19 @@ set -u ...@@ -28,20 +28,19 @@ set -u
if [ -z "${G_TEST_SRCDIR-}" ]; then if [ -z "${G_TEST_SRCDIR-}" ]; then
me="$(readlink -f "$0")" me="$(readlink -f "$0")"
srcdir="${me%/*}" G_TEST_SRCDIR="${me%/*}"
G_TEST_SRCDIR="${srcdir%/*}"
fi fi
cd "$G_TEST_SRCDIR" cd "$G_TEST_SRCDIR/.."
export MYPYPATH="${PYTHONPATH:="$(pwd)"}" export MYPYPATH="${PYTHONPATH:="$(pwd)"}"
i=0 i=0
for script in \ for script in \
"${G_TEST_SRCDIR}"/*.py \ ./*.py \
"${G_TEST_SRCDIR}"/pressure-vessel-test-ui \ ./pressure-vessel-test-ui \
"${G_TEST_SRCDIR}"/sysroot/*.py \ ./sysroot/*.py \
"${G_TEST_SRCDIR}"/tests/*.py \ ./tests/*.py \
; do ; do
i=$((i + 1)) i=$((i + 1))
if [ "x${MYPY:="$(command -v mypy || echo false)"}" = xfalse ]; then if [ "x${MYPY:="$(command -v mypy || echo false)"}" = xfalse ]; then
......
...@@ -28,11 +28,10 @@ set -u ...@@ -28,11 +28,10 @@ set -u
if [ -z "${G_TEST_SRCDIR-}" ]; then if [ -z "${G_TEST_SRCDIR-}" ]; then
me="$(readlink -f "$0")" me="$(readlink -f "$0")"
srcdir="${me%/*}" G_TEST_SRCDIR="${me%/*}"
G_TEST_SRCDIR="${srcdir%/*}"
fi fi
cd "$G_TEST_SRCDIR" cd "$G_TEST_SRCDIR/.."
if [ "x${PYCODESTYLE:=pycodestyle}" = xfalse ] || \ if [ "x${PYCODESTYLE:=pycodestyle}" = xfalse ] || \
[ -z "$(command -v "$PYCODESTYLE")" ]; then [ -z "$(command -v "$PYCODESTYLE")" ]; then
...@@ -48,10 +47,10 @@ echo "1..1" ...@@ -48,10 +47,10 @@ echo "1..1"
if "${PYCODESTYLE}" \ if "${PYCODESTYLE}" \
--ignore=E402,W503 \ --ignore=E402,W503 \
"$G_TEST_SRCDIR"/*.py \ ./*.py \
"${G_TEST_SRCDIR}"/pressure-vessel-test-ui \ ./pressure-vessel-test-ui \
"${G_TEST_SRCDIR}"/sysroot/*.py \ ./sysroot/*.py \
"${G_TEST_SRCDIR}"/tests/*.py \ ./tests/*.py \
>&2; then >&2; then
echo "ok 1 - $PYCODESTYLE reported no issues" echo "ok 1 - $PYCODESTYLE reported no issues"
else else
......
...@@ -28,20 +28,19 @@ set -u ...@@ -28,20 +28,19 @@ set -u
if [ -z "${G_TEST_SRCDIR-}" ]; then if [ -z "${G_TEST_SRCDIR-}" ]; then
me="$(readlink -f "$0")" me="$(readlink -f "$0")"
srcdir="${me%/*}" G_TEST_SRCDIR="${me%/*}"
G_TEST_SRCDIR="${srcdir%/*}"
fi fi
cd "$G_TEST_SRCDIR" cd "$G_TEST_SRCDIR/.."
if [ "x${PYFLAKES:=pyflakes3}" = xfalse ] || \ if [ "x${PYFLAKES:=pyflakes3}" = xfalse ] || \
[ -z "$(command -v "$PYFLAKES")" ]; then [ -z "$(command -v "$PYFLAKES")" ]; then
echo "1..0 # SKIP pyflakes3 not found" echo "1..0 # SKIP pyflakes3 not found"
elif "${PYFLAKES}" \ elif "${PYFLAKES}" \
"${G_TEST_SRCDIR}"/*.py \ ./*.py \
"${G_TEST_SRCDIR}"/pressure-vessel-test-ui \ ./pressure-vessel-test-ui \
"${G_TEST_SRCDIR}"/sysroot/*.py \ ./sysroot/*.py \
"${G_TEST_SRCDIR}"/tests/*.py \ ./tests/*.py \
>&2; then >&2; then
echo "1..1" echo "1..1"
echo "ok 1 - $PYFLAKES reported no issues" echo "ok 1 - $PYFLAKES reported no issues"
......
...@@ -28,19 +28,18 @@ fi ...@@ -28,19 +28,18 @@ fi
if [ -z "${G_TEST_SRCDIR-}" ]; then if [ -z "${G_TEST_SRCDIR-}" ]; then
me="$(readlink -f "$0")" me="$(readlink -f "$0")"
srcdir="${me%/*}" G_TEST_SRCDIR="${me%/*}"
G_TEST_SRCDIR="${srcdir%/*}"
fi fi
cd "$G_TEST_SRCDIR" cd "$G_TEST_SRCDIR/.."
n=0 n=0
for shell_script in \ for shell_script in \
pressure-vessel-unruntime \ ./pressure-vessel-unruntime \
pressure-vessel-unruntime-scout \ ./pressure-vessel-unruntime-scout \
pressure-vessel-unruntime-test-ui \ ./pressure-vessel-unruntime-test-ui \
pressure-vessel-locale-gen \ ./pressure-vessel-locale-gen \
tests/*.sh \ ./tests/*.sh \
; do ; do
n=$((n + 1)) n=$((n + 1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment