1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#!/bin/sh
# Copyright © 2016-2020 Simon McVittie
# Copyright © 2018 Collabora Ltd.
# SPDX-License-Identifier: GPL-2+
set -e
set -u
testdir="$(dirname "$(readlink -f "$0")")"
rootdir="$(dirname "$testdir")"
export MYPYPATH="${PYTHONPATH:="${rootdir}/lib"}"
i=0
for file in \
"$rootdir"/lib/*.py \
"$rootdir"/runner/autopkgtest \
"$rootdir"/tests/*.py \
"$rootdir"/tests/autopkgtest \
"$rootdir"/tests/autopkgtest_args \
"$rootdir"/tests/qemu \
"$rootdir"/tests/testdesc \
"$rootdir"/tools/autopkgtest-build-docker \
"$rootdir"/tools/autopkgtest-build-lxc \
"$rootdir"/tools/autopkgtest-build-lxd \
"$rootdir"/tools/autopkgtest-build-qemu \
"$rootdir"/tools/autopkgtest-buildvm-ubuntu-cloud \
"$rootdir"/virt/autopkgtest-virt-chroot \
"$rootdir"/virt/autopkgtest-virt-docker \
"$rootdir"/virt/autopkgtest-virt-lxc \
"$rootdir"/virt/autopkgtest-virt-lxd \
"$rootdir"/virt/autopkgtest-virt-null \
"$rootdir"/virt/autopkgtest-virt-qemu \
"$rootdir"/virt/autopkgtest-virt-schroot \
"$rootdir"/virt/autopkgtest-virt-ssh \
"$rootdir"/virt/autopkgtest-virt-unshare \
; do
i=$((i + 1))
if [ "${MYPY:="$(command -v mypy || echo false)"}" = false ]; then
echo "ok $i - $file # SKIP mypy not found"
elif "${MYPY}" \
--python-executable="${PYTHON:=python3}" \
--follow-imports=skip \
--ignore-missing-imports \
"$file"; then
echo "ok $i - $file"
else
echo "not ok $i - $file # TODO mypy issues reported"
fi
done
echo "1..$i"
# vim:set sw=4 sts=4 et:
|