Merge pull request #180 from noloader/travis

Avoid calling exit in Travis script
This commit is contained in:
Wouter Wijngaards 2020-03-04 08:17:39 +01:00 committed by GitHub
commit ee9fd34d1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,51 +147,41 @@ jobs:
arch: amd64 arch: amd64
name: Android x86_64, Linux, Amd64 name: Android x86_64, Linux, Amd64
# The Travis docs say to avoid calling exit in the script. It leads to
# some code duplication to avoid failures in cross-compiles. Also see
# https://docs.travis-ci.com/user/job-lifecycle/ in the Travis docs.
script: script:
- | - |
if [ "$TEST_UBSAN" = "yes" ]; then if [ "$TEST_UBSAN" = "yes" ]; then
export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover" export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover"
./configure ./configure
make -j 2
make test
elif [ "$TEST_ASAN" = "yes" ]; then elif [ "$TEST_ASAN" = "yes" ]; then
export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address" export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address"
./configure ./configure
make -j 2
make test
elif [ "$TEST_ANDROID" = "yes" ]; then elif [ "$TEST_ANDROID" = "yes" ]; then
export AUTOTOOLS_BUILD="$(./config.guess)" export AUTOTOOLS_BUILD="$(./config.guess)"
if ! ./contrib/android/install_ndk.sh ; then ./contrib/android/install_ndk.sh
echo "Failed to install Android SDK and NDK" source ./contrib/android/setenv_android.sh "$ANDROID_CPU"
exit 1 ./contrib/android/install_openssl.sh
fi ./contrib/android/install_expat.sh
if ! source ./contrib/android/setenv_android.sh "$ANDROID_CPU"; then ./configure \
echo "Failed to set Android environment"
exit 1
fi
if ! ./contrib/android/install_openssl.sh; then
echo "Failed to build and install OpenSSL"
exit 1
fi
if ! ./contrib/android/install_expat.sh; then
echo "Failed to build and install Expat"
exit 1
fi
if ! ./configure \
--build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \ --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \
--prefix="$ANDROID_SYSROOT" \ --prefix="$ANDROID_SYSROOT" \
--with-ssl="$ANDROID_SYSROOT" --disable-gost \ --with-ssl="$ANDROID_SYSROOT" --disable-gost \
--with-libexpat="$ANDROID_SYSROOT"; --with-libexpat="$ANDROID_SYSROOT";
then make -j 2
echo "Failed to configure Unbound"
exit 1
fi
if ! make -j 2; then
echo "Failed to build Unbound"
exit 1
fi
exit 0
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/ ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/
make -j 2
make test
(cd testdata/clang-analysis.tdir; bash clang-analysis.test)
else else
./configure --enable-debug --disable-flto ./configure --enable-debug --disable-flto
fi make -j 2
if ! make -j 2; then exit 1; fi make test
if ! make test; then exit 1; fi
(cd testdata/clang-analysis.tdir; bash clang-analysis.test) (cd testdata/clang-analysis.tdir; bash clang-analysis.test)
fi