build-style/python-module.sh: add do_check

This commit is contained in:
Piotr Wójcik 2019-03-21 00:19:40 +01:00 committed by maxice8
parent 2219c715c4
commit a4e3f89907
1 changed files with 18 additions and 0 deletions

View File

@ -29,6 +29,24 @@ do_build() {
done
}
do_check() {
: ${python_versions:="2.7 $py3_ver"}
for pyver in $python_versions; do
ln -s build-${pyver} build
if [ -z "$make_check_target" ]; then
if ! python${pyver} setup.py --help test >/dev/null 2>&1; then
msg_warn "No command 'test' defined by setup.py for python${pyver}.\n"
rm build
return 0
fi
fi
python${pyver} setup.py ${make_check_target:-test} ${make_check_args}
rm build
done
}
do_install() {
: ${python_versions:="2.7 $py3_ver"}
local pyver= pysufx=