Skip to content

Commit bb4682a

Browse files
committed
TST: fail tests on compiler warnings
1 parent c15f774 commit bb4682a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tools/travis-test.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@ setup_base()
2323
# install' also has the advantage that it tests that numpy is 'pip
2424
# install' compatible, see e.g. gh-2766...
2525
if [ -z "$USE_DEBUG" ]; then
26-
$PIP install .
26+
if [ -z "$IN_CHROOT" ]; then
27+
$PIP install .
28+
else
29+
sysflags="$($PYTHON -c "from distutils import sysconfig; print (sysconfig.get_config_var('CFLAGS'))")"
30+
# windows compilers have this requirement
31+
CFLAGS="$sysflags -Werror=declaration-after-statement -Werror=nonnull -Wlogical-op" $PIP install . 2>&1 | tee log
32+
grep -v "_configtest" log | grep -vE "ld returned 1|no previously-included files matching" | grep -E "warning\>";
33+
# accept a mysterious memset warning that shows with -flto
34+
test $(grep -v "_configtest" log | grep -vE "ld returned 1|no previously-included files matching" | grep -E "warning\>" -c) -lt 2;
35+
fi
2736
else
2837
sysflags="$($PYTHON -c "from distutils import sysconfig; print (sysconfig.get_config_var('CFLAGS'))")"
2938
# windows compilers have this requirement
@@ -139,7 +148,7 @@ elif [ -n "$USE_CHROOT" ] && [ $# -eq 0 ]; then
139148
DIR=/chroot
140149
setup_chroot $DIR
141150
# run again in chroot with this time testing
142-
sudo linux32 chroot $DIR bash -c "cd numpy && PYTHON=python3 PIP=pip3 $0 test"
151+
sudo linux32 chroot $DIR bash -c "cd numpy && PYTHON=python3 PIP=pip3 IN_CHROOT=1 $0 test"
143152
elif [ -n "$USE_BENTO" ] && [ $# -eq 0 ]; then
144153
setup_bento
145154
# run again this time testing

0 commit comments

Comments
 (0)