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

lint: Cope gracefully with not finding any Python scripts to test


This makes these scripts a better template to drop into other projects.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent d458f700
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,11 @@ for script in "$@"; do ...@@ -33,6 +33,11 @@ for script in "$@"; do
echo "not ok $i - $script # TODO mypy issues reported" echo "not ok $i - $script # TODO mypy issues reported"
fi fi
done done
echo "1..$i"
if [ "$i" = 0 ]; then
echo "1..0 # SKIP no Python scripts to test"
else
echo "1..$i"
fi
# vim:set sw=4 sts=4 et: # vim:set sw=4 sts=4 et:
...@@ -47,6 +47,10 @@ for script in \ ...@@ -47,6 +47,10 @@ for script in \
./tests/*.py \ ./tests/*.py \
./tests/*/*.py \ ./tests/*/*.py \
; do ; do
if ! [ -e "$script" ]; then
continue
fi
i=$((i + 1)) i=$((i + 1))
if [ "${MYPY:="$(command -v mypy || echo false)"}" = false ]; then if [ "${MYPY:="$(command -v mypy || echo false)"}" = false ]; then
echo "ok $i - $script # SKIP mypy not found" echo "ok $i - $script # SKIP mypy not found"
...@@ -60,6 +64,11 @@ for script in \ ...@@ -60,6 +64,11 @@ for script in \
echo "not ok $i - $script # TODO mypy issues reported" echo "not ok $i - $script # TODO mypy issues reported"
fi fi
done done
echo "1..$i"
if [ "$i" = 0 ]; then
echo "1..0 # SKIP no Python scripts to test"
else
echo "1..$i"
fi
# vim:set sw=4 sts=4 et: # vim:set sw=4 sts=4 et:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment