]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Avoid calling exit in Travis script 180/head
authorJeffrey Walton <noloader@gmail.com>
Tue, 3 Mar 2020 19:01:06 +0000 (14:01 -0500)
committerJeffrey Walton <noloader@gmail.com>
Tue, 3 Mar 2020 19:01:06 +0000 (14:01 -0500)
The Travis docs state it should not be done. Blame Jeffrey Walton. Sorry about that.

.travis.yml

index 5fe4735a56f6931d1c616a18d5c609d2f5dc8f62..41c4b0380165604ccf9fb83d981a4778060abd16 100644 (file)
@@ -147,51 +147,41 @@ jobs:
       arch: 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:
   - |
     if [ "$TEST_UBSAN" = "yes" ]; then
       export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover"
       ./configure
+      make -j 2
+      make test
     elif [ "$TEST_ASAN" = "yes" ]; then
       export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address"
       ./configure
+      make -j 2
+      make test
     elif [ "$TEST_ANDROID" = "yes" ]; then
       export AUTOTOOLS_BUILD="$(./config.guess)"
-      if ! ./contrib/android/install_ndk.sh ; then
-        echo "Failed to install Android SDK and NDK"
-        exit 1
-      fi
-      if ! source ./contrib/android/setenv_android.sh "$ANDROID_CPU"; then
-        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 \
+      ./contrib/android/install_ndk.sh
+      source ./contrib/android/setenv_android.sh "$ANDROID_CPU"
+      ./contrib/android/install_openssl.sh
+      ./contrib/android/install_expat.sh
+      ./configure \
         --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \
         --prefix="$ANDROID_SYSROOT" \
         --with-ssl="$ANDROID_SYSROOT" --disable-gost \
         --with-libexpat="$ANDROID_SYSROOT";
-      then
-        echo "Failed to configure Unbound"
-        exit 1
-      fi
-      if ! make -j 2; then
-        echo "Failed to build Unbound"
-        exit 1
-      fi
-      exit 0
+      make -j 2
     elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
       ./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
       ./configure --enable-debug --disable-flto
+      make -j 2
+      make test
+      (cd testdata/clang-analysis.tdir; bash clang-analysis.test)
     fi
-    if ! make -j 2; then exit 1; fi
-    if ! make test; then exit 1; fi
-    (cd testdata/clang-analysis.tdir; bash clang-analysis.test)