From bb4682a091e9652bfd886a686b3fa85a9636028d Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Fri, 3 Jul 2015 00:40:10 +0200 Subject: TST: fail tests on compiler warnings --- tools/travis-test.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tools/travis-test.sh') diff --git a/tools/travis-test.sh b/tools/travis-test.sh index 705876f56..4b6a39c25 100755 --- a/tools/travis-test.sh +++ b/tools/travis-test.sh @@ -23,7 +23,16 @@ setup_base() # install' also has the advantage that it tests that numpy is 'pip # install' compatible, see e.g. gh-2766... if [ -z "$USE_DEBUG" ]; then - $PIP install . + if [ -z "$IN_CHROOT" ]; then + $PIP install . + else + sysflags="$($PYTHON -c "from distutils import sysconfig; print (sysconfig.get_config_var('CFLAGS'))")" + # windows compilers have this requirement + CFLAGS="$sysflags -Werror=declaration-after-statement -Werror=nonnull -Wlogical-op" $PIP install . 2>&1 | tee log + grep -v "_configtest" log | grep -vE "ld returned 1|no previously-included files matching" | grep -E "warning\>"; + # accept a mysterious memset warning that shows with -flto + test $(grep -v "_configtest" log | grep -vE "ld returned 1|no previously-included files matching" | grep -E "warning\>" -c) -lt 2; + fi else sysflags="$($PYTHON -c "from distutils import sysconfig; print (sysconfig.get_config_var('CFLAGS'))")" # windows compilers have this requirement @@ -139,7 +148,7 @@ elif [ -n "$USE_CHROOT" ] && [ $# -eq 0 ]; then DIR=/chroot setup_chroot $DIR # run again in chroot with this time testing - sudo linux32 chroot $DIR bash -c "cd numpy && PYTHON=python3 PIP=pip3 $0 test" + sudo linux32 chroot $DIR bash -c "cd numpy && PYTHON=python3 PIP=pip3 IN_CHROOT=1 $0 test" elif [ -n "$USE_BENTO" ] && [ $# -eq 0 ]; then setup_bento # run again this time testing -- cgit v1.2.3