diff --git a/lib/cretonne/meta/check.sh b/lib/cretonne/meta/check.sh index f01653b57e..072066ebec 100755 --- a/lib/cretonne/meta/check.sh +++ b/lib/cretonne/meta/check.sh @@ -2,11 +2,21 @@ set -e cd $(dirname "$0") -# Run unit tests. +echo "=== Python unit tests ===" python -m unittest discover +runif() { + if command -v "$1" > /dev/null; then + echo "=== $1 ===" + "$@" + else + echo "$1 not found" + fi +} + # Check Python sources for Python 3 compatibility using pylint. # # Install pylint with 'pip install pylint'. -pylint --py3k --reports=no -- *.py cretonne isa -flake8 . +runif pylint --py3k --reports=no -- *.py cretonne isa +runif flake8 . +runif mypy --py2 build.py