travis: Include testsuite.log on failure.
[cascardo/ovs.git] / .travis / build.sh
index 56623ea..db7a3d3 100755 (executable)
@@ -3,6 +3,7 @@
 set -o errexit
 
 KERNELSRC=""
+CFLAGS="-Werror"
 
 function install_kernel()
 {
@@ -22,9 +23,9 @@ function install_dpdk()
     tar xzvf dpdk-1.7.0.tar.gz > /dev/null
     cd dpdk-1.7.0
     find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/'
+    sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' config/common_linuxapp
     make config CC=gcc T=x86_64-native-linuxapp-gcc
     make CC=gcc RTE_KERNELDIR=$KERNELSRC
-    sudo make install CC=gcc T=x86_64-native-linuxapp-gcc RTE_KERNELDIR=$KERNELSRC
     echo "Installed DPDK source in $(pwd)"
     cd ..
 }
@@ -38,15 +39,26 @@ if [ "$KERNEL" ] || [ "$DPDK" ]; then
     install_kernel
 fi
 
-[ "$DPDK" ] && install_dpdk
+[ "$DPDK" ] && {
+    install_dpdk
+    # Disregard bad function cassts until DPDK is fixed
+    CFLAGS="$CFLAGS -Wno-error=bad-function-cast -Wno-error=cast-align"
+}
 
 configure_ovs $*
 
+
 if [ $CC = "clang" ]; then
-    make CFLAGS="-Werror -Wno-error=unused-command-line-argument"
+    make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
 else
-    make CFLAGS="-Werror" C=1
-    [ "$TESTSUITE" ] && make distcheck
+    make CFLAGS="$CFLAGS" C=1
+    if [ $TESTSUITE ]; then
+        if ! make distcheck; then
+            # testsuite.log is necessary for debugging.
+            cat */_build/tests/testsuite.log
+            exit 1
+        fi
+    fi
 fi
 
 exit 0