From 22565e0b785ac8c9bebe71ae6bd22d5f876d215e Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Thu, 14 Aug 2014 16:49:55 -0500 Subject: [PATCH 1/3] Added .travis.yml --- .travis.yml | 10 ++++++++++ travis.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .travis.yml create mode 100644 travis.sh 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/travis.sh b/travis.sh new file mode 100644 index 000000000000..9885dc7e0e00 --- /dev/null +++ b/travis.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# 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 +for t in mypy.test.testpythoneval mypy.test.testcgen; do + echo $t + python "$DRIVER" -m $t +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 +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 + done +else + echo "Skipping lib-python type checks(Not Python 3.2!)" +fi From 88f51b3aab8fc9c3e3db31c4361a9c77253812ff Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Thu, 14 Aug 2014 17:22:58 -0500 Subject: [PATCH 2/3] Add build status to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) 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? ------------- From a85beb4669db7b85cd56a6c5160fff2ae31a24db Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Sat, 16 Aug 2014 13:43:33 -0500 Subject: [PATCH 3/3] Make sure test failures are tracked --- travis.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/travis.sh b/travis.sh index 9885dc7e0e00..6e2dc6f3334f 100644 --- a/travis.sh +++ b/travis.sh @@ -1,5 +1,12 @@ #!/bin/bash +result=0 + +fail() +{ + result = 1 +} + # Setup stuff DRIVER=$PWD/scripts/mypy @@ -10,10 +17,10 @@ export PYTHONPATH=`pwd`/lib-typing/3.2:`pwd` echo Running tests... echo echo tests.py -python "$DRIVER" tests.py +python "$DRIVER" tests.py || fail for t in mypy.test.testpythoneval mypy.test.testcgen; do echo $t - python "$DRIVER" -m $t + python "$DRIVER" -m $t || fail done # Stub checks @@ -27,14 +34,12 @@ done echo Type checking stubs... echo -python "$DRIVER" -S $STUBTEST +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 @@ -44,8 +49,10 @@ if [ "`python -c 'from sys import version_info as vi; print(vi.major, vi.minor)' for f in test/test_*.py; do mod=test.`basename "$f" .py` echo $mod - python "$DRIVER" -S -m $mod + python "$DRIVER" -S -m $mod || fail done else echo "Skipping lib-python type checks(Not Python 3.2!)" fi + +exit $result