diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..702a78c143bf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: python +python: + - "3.2" + - "3.3" + - "3.4" + - "pypy3" + +install: python setup.py install + +script: bash travis.sh diff --git a/README.md b/README.md index 0b5e78e8a4a1..bf0098846ec4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Mypy Readme =========== +[![Build Status](https://travis-ci.org/JukkaL/mypy.svg)](https://travis-ci.org/JukkaL/mypy) + What is mypy? ------------- diff --git a/travis.sh b/travis.sh new file mode 100644 index 000000000000..6e2dc6f3334f --- /dev/null +++ b/travis.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +result=0 + +fail() +{ + result = 1 +} + +# Setup stuff + +DRIVER=$PWD/scripts/mypy +export PYTHONPATH=`pwd`/lib-typing/3.2:`pwd` + +# Basic tests + +echo Running tests... +echo +echo tests.py +python "$DRIVER" tests.py || fail +for t in mypy.test.testpythoneval mypy.test.testcgen; do + echo $t + python "$DRIVER" -m $t || fail +done + +# Stub checks + +STUBTEST=_test_stubs.py +cd stubs/3.2 +ls *.py | sed s/\\.py//g | sed "s/^/import /g" > $STUBTEST +for m in os os.path; do + echo "import $m" >> $STUBTEST +done + +echo Type checking stubs... +echo +python "$DRIVER" -S $STUBTEST || fail +rm $STUBTEST +cd .. + +# Sample checks + +# Only run under 3.2 + +if [ "`python -c 'from sys import version_info as vi; print(vi.major, vi.minor)'`" == "3 3" ]; then + echo Type checking lib-python... + echo + cd lib-python/3.2 + for f in test/test_*.py; do + mod=test.`basename "$f" .py` + echo $mod + python "$DRIVER" -S -m $mod || fail + done +else + echo "Skipping lib-python type checks(Not Python 3.2!)" +fi + +exit $result