Skip to content

Commit a85beb4

Browse files
committed
Make sure test failures are tracked
1 parent 88f51b3 commit a85beb4

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

travis.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/bash
22

3+
result=0
4+
5+
fail()
6+
{
7+
result = 1
8+
}
9+
310
# Setup stuff
411

512
DRIVER=$PWD/scripts/mypy
@@ -10,10 +17,10 @@ export PYTHONPATH=`pwd`/lib-typing/3.2:`pwd`
1017
echo Running tests...
1118
echo
1219
echo tests.py
13-
python "$DRIVER" tests.py
20+
python "$DRIVER" tests.py || fail
1421
for t in mypy.test.testpythoneval mypy.test.testcgen; do
1522
echo $t
16-
python "$DRIVER" -m $t
23+
python "$DRIVER" -m $t || fail
1724
done
1825

1926
# Stub checks
@@ -27,14 +34,12 @@ done
2734

2835
echo Type checking stubs...
2936
echo
30-
python "$DRIVER" -S $STUBTEST
37+
python "$DRIVER" -S $STUBTEST || fail
3138
rm $STUBTEST
3239
cd ..
3340

3441
# Sample checks
3542

36-
37-
3843
# Only run under 3.2
3944

4045
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)'
4449
for f in test/test_*.py; do
4550
mod=test.`basename "$f" .py`
4651
echo $mod
47-
python "$DRIVER" -S -m $mod
52+
python "$DRIVER" -S -m $mod || fail
4853
done
4954
else
5055
echo "Skipping lib-python type checks(Not Python 3.2!)"
5156
fi
57+
58+
exit $result

0 commit comments

Comments
 (0)