summaryrefslogtreecommitdiff
path: root/.travis
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2019-02-08 19:48:56 +0300
committerBen Pfaff <blp@ovn.org>2019-02-11 08:44:04 -0800
commit8e7d5b6434bccb01e0403620df9114e77ac8a244 (patch)
tree2f5d9af2c76bd8724186cb77110dff11683fe44f /.travis
parent914ea15d854c2106992d2f10ee9429ee07ae2b02 (diff)
downloadopenvswitch-8e7d5b6434bccb01e0403620df9114e77ac8a244.tar.gz
travis: Run testsuite with desired options.
'make distcheck' executes it's own './configure' without any options provided to the script. This means that in current configuration Travis CI always re-builds and runs testsuite on a defualt binaries. i.e. we're not checking testsuite with DPDK, not checking testsuite with '--enable-shared' and not checking it with '-ljemalloc'. We just 8 times running the testsuite without arguments. Only compiler changes (gcc or clang) because CC is exported by Travis. This patch reorders the commands in the build script and provides 'DISTCHECK_CONFIGURE_FLAGS' to force 'make distcheck' using our desired configuration. Another issue that addressed here is that we will no longe build twice in case of TESTSUITE. For linking inside the distcheck we also need to provide absulute path to DPDK libraries. 'configure' executed before 'distcheck' to have a Makefile target. It's executed without arguments because 'configure' inside the 'distcheck' will fail if we'll use sparse-wrapped CC. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to '.travis')
-rwxr-xr-x.travis/linux-build.sh33
1 files changed, 20 insertions, 13 deletions
diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 8c931ebc5..e91fa1395 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -95,37 +95,44 @@ if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
# Disregard cast alignment errors until DPDK is fixed
CFLAGS="$CFLAGS -Wno-cast-align"
fi
- EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=./dpdk-$DPDK_VER/build"
+ EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/dpdk-$DPDK_VER/build"
elif [ "$CC" != "clang" ]; then
# DPDK headers currently trigger sparse errors
SPARSE_FLAGS="$SPARSE_FLAGS -Wsparse-error"
fi
-configure_ovs $EXTRA_OPTS $*
-
-make selinux-policy
-
-# Only build datapath if we are testing kernel w/o running testsuite
-if [ "$KERNEL" ] && [ ! "$TESTSUITE" ] && \
- [ ! "$DPDK" ] && [ ! "$DPDK_SHARED" ]; then
- cd datapath
-fi
+OPTS="$EXTRA_OPTS $*"
if [ "$CC" = "clang" ]; then
- make -j2 CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
+ export OVS_CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
elif [[ $BUILD_ENV =~ "-m32" ]]; then
# Disable sparse for 32bit builds on 64bit machine
- make -j2 CFLAGS="$CFLAGS $BUILD_ENV"
+ export OVS_CFLAGS="$CFLAGS $BUILD_ENV"
else
- make -j2 CFLAGS="$CFLAGS $BUILD_ENV $SPARSE_FLAGS" C=1
+ OPTS="$OPTS --enable-sparse"
+ export OVS_CFLAGS="$CFLAGS $BUILD_ENV $SPARSE_FLAGS"
fi
if [ "$TESTSUITE" ]; then
+ # 'distcheck' will reconfigure with required options.
+ # Now we only need to prepare the Makefile wihtout sparse-wrapped CC.
+ configure_ovs
+
+ export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
if ! make distcheck TESTSUITEFLAGS=-j4 RECHECK=yes; then
# testsuite.log is necessary for debugging.
cat */_build/tests/testsuite.log
exit 1
fi
+else
+ configure_ovs $OPTS
+ make selinux-policy
+
+ # Only build datapath if we are testing kernel w/o running testsuite
+ if [ "$KERNEL" ] && [ ! "$DPDK" ] && [ ! "$DPDK_SHARED" ]; then
+ cd datapath
+ fi
+ make -j4
fi
exit 0