]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Merge branch 'develop' into develop 9/head
authorwtoorop <willem@nlnetlabs.nl>
Wed, 17 Jul 2019 13:44:59 +0000 (15:44 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Jul 2019 13:44:59 +0000 (15:44 +0200)
1  2 
makedist.sh
test/test_all.sh
test/test_ci.sh

diff --cc makedist.sh
index 8a918180eaab101bca583a57f4b28c77b537dd38,1ea8892b68f17ebd8b61541a71cbe1efb5f48744..3d6c7d8e19a60f4f8e7327cc5efa5db25c6a56bf
@@@ -122,13 -122,13 +122,13 @@@ info "SNAPSHOT is $SNAPSHOT
  
  # Creating temp directory
  info "Creating temporary working directory"
 -temp_dir=`mktemp -d ldns-dist-XXXXXX`
 -doc_dir=`mktemp -d ldns-dist-XXXXXX`
 +temp_dir=$(mktemp -d ldns-dist-XXXXXX)
 +doc_dir=$(mktemp -d ldns-dist-XXXXXX)
  info "Directory '$temp_dir' created."
 -cd $temp_dir
 +cd "$temp_dir"
  
  info "Exporting source from GIT"
- git clone git://git.nlnetlabs.nl/ldns/ || error_cleanup "git command failed"
+ git clone https://github.com/NLnetLabs/ldns.git || error_cleanup "git command failed"
  cd ldns || error_cleanup "LDNS not exported correctly from git"
  git checkout "$CHECKOUT" || error_cleanup "Could not checkout $CHECKOUT"
  git submodule update --init || error_cleanup "Could not update submodules"
index af4a920d7e287503b73324032785010de78dd353,59ad08c2e98a59fb51431154c68d83cb5e00fa69..32bdf19770072892f1eecc0cdb6c8169f83c1c0d
@@@ -5,28 -4,29 +5,34 @@@ cd tes
  . common.sh
  
  # find tpkg
- if test -x "$(command -v tpkg 2>&1)"; then
-       TPKG=tpkg
- else
-       TPKG="$1"
-       if [ -z "$TPKG" ]
-       then
-       TPKG="$HOME/repos/tpkg/tpkg"
-       fi
 -
+ if [ -z "$TPKG" -o ! -x "$TPKG" ]
+ then
 -        if [ -x tpkg/tpkg ]  ; then TPKG=`pwd`/tpkg/tpkg
 -        elif [ -x test/tpkg/tpkg ]      ; then TPKG=`pwd`/test/tpkg/tpkg
 -        elif which tpkg > /dev/null     ; then TPKG=`which tpkg`
++        if [ -x tpkg/tpkg ]           ; then TPKG="$(pwd)/tpkg/tpkg"
++        elif [ -x test/tpkg/tpkg ]    ; then TPKG="$(pwd)/test/tpkg/tpkg"
++        elif command -v tpkg > /dev/null; then TPKG="$(command -v tpkg)"
+         else
+               TPKG=$1
+               if [ -z "$TPKG" ]
+               then
+                       TPKG=$HOME/repos/tpkg/tpkg
+                       echo Did not find tpkg program!
+                       exit -1
+               fi
+         fi
  fi
  
 +is_freebsd=$(uname -s 2>&1 | grep -i -c 'freebsd')
  test_tool_avail "dig"
  
 -echo start the test at `date` in `pwd`
 -[ "$1" = "clean" -o "$2" = "clean" ] && $TPKG clean
 +echo start the test at "$(date)" in "$(pwd)"
 +[ "$1" = "clean" ] || [ "$2" = "clean" ] && $TPKG clean
  $TPKG -a ../.. fake 01-compile.tpkg
 -$TPKG -a ../.. fake 02-lint.tpkg              # Works only on FreeBSD really
 +
 +# Works only on FreeBSD really
 +if [[ "$is_freebsd" -ne 0 ]]; then
 +    $TPKG -a ../.. fake 02-lint.tpkg
 +fi
 +
  $TPKG -a ../.. fake 07-compile-examples.tpkg
  $TPKG -a ../.. fake 16-compile-builddir.tpkg
  $TPKG -a ../.. fake 30-load-pyldns.tpkg
diff --cc test/test_ci.sh
index 144c653b7647a5d054ed54c2c49041524bf63502,c32279ba7e9820525c6e11933e45653453bf201b..23a71a57d334058ae03aafaf9697104a8eb982ec
@@@ -17,26 -17,23 +17,24 @@@ els
          NO_REGRESSION=1
  fi
  
 -if [ -z "$TPKG" -o ! -x "$TPKG" ]
 +if [ -z "$TPKG" ] || [ ! -x "$TPKG" ]
  then
-         if command -v tpkg > /dev/null        ; then TPKG="$(command -v tpkg)"
-         elif [ -x "$HOME/bin/tpkg" ]  ; then TPKG="$HOME/bin/tpkg"
-         elif [ -x "$HOME/local/bin/tpkg" ]; then TPKG="$HOME/local/bin/tpkg"
-         elif [ -x /home/tpkg/bin/tpkg ]       ; then TPKG=/home/tpkg/bin/tpkg
-         elif [ -x ../tpkg/tpkg ]      ; then TPKG=../tpkg/tpkg
 -        if [ -x tpkg/tpkg ]   ; then TPKG=`pwd`/tpkg/tpkg
 -        elif [ -x test/tpkg/tpkg ]    ; then TPKG=`pwd`/test/tpkg/tpkg
 -        elif which tpkg > /dev/null   ; then TPKG=`which tpkg`
++        if [ -x tpkg/tpkg ]           ; then TPKG="$(pwd)/tpkg/tpkg"
++        elif [ -x test/tpkg/tpkg ]    ; then TPKG="$(pwd)/test/tpkg/tpkg"
++        elif command -v tpkg > /dev/null; then TPKG="$(command -v tpkg)"
          else
                  echo Did not find tpkg program!
 -                exit -1
 +                exit 255    # Shell can only return 0-255
          fi
  fi
 +
  # RUN THE TESTS
 -for tests in $BUILD_DIR/test/*.tpkg 
 +for tests in "$BUILD_DIR"/test/*.tpkg
  do
 -      TESTFN=`basename $tests`
 -      TESTNR=`echo $TESTFN | sed 's/-.*$//g'`
 -      [ ! -z "$ONLY_TEST" -a x$ONLY_TEST != x$TESTNR ] && continue
 -      case $TESTNR in
 +      TESTFN="$(basename "$tests")"
 +      TESTNR="$(echo "$TESTFN" | sed 's/-.*$//g')"
 +      [ -n "$ONLY_TEST" ] && [ x"$ONLY_TEST" != x"$TESTNR" ] && continue
 +      case "$TESTNR" in
        [3-5][0-9]*)    [ $NO_REGRESSION = 1 ] && continue
                        ;;
        esac
                ;;
        32)     # No backwards compatibility regression testing 
                # when .so had major version bumb.
 -              chmod +x $BUILD_DIR/packaging/ldns-config
 -              BINAPI=`$BUILD_DIR/packaging/ldns-config --libversion`
 +              chmod +x "$BUILD_DIR/packaging/ldns-config"
 +              BINAPI=$("$BUILD_DIR/packaging/ldns-config" --libversion)
                [ "x${BINAPI#*.}" = "x0.0" ] && continue
        esac
 -      $TPKG -b $BUILD_DIR/test -a $BUILD_DIR exe $TESTFN
 +      $TPKG -b "$BUILD_DIR/test" -a "$BUILD_DIR" exe "$TESTFN"
  done
  
- # -----------------------------------------------------------------------------
- # ----  Testing part
- #
- ( cd test; $TPKG -q -n "$(find ./ -name 'result.*' -printf "%f\n" | wc -l)" report >/dev/null )
- # -----------------------------------------------------------------------------
- # ----  Reusable reporting part
- #
- if test "$?" -eq "0"; then STATUS="pass"; else STATUS="FAIL"; fi
- CI_ID=2
- REPOS=$(basename "$(pwd)")
- REPOS=${REPOS%.git}
- CI_URI="${CI_PROJECT_URL}/builds/${CI_BUILD_ID}"
- while [ $# -ge 1 ]
- do
-       echo "Sending mail to $1... ($# >= 1)"
-       (
-               git log -1 --format="From %H %ad%nFrom: %an <%ae>"
-               BRANCH=$(
-                       for W in $( git log -1 --format=%d | tr "()," "   " )
-                       do echo "$W"
-                       done | grep -v HEAD | head -1
-                       )
-               BRANCH="${BRANCH#origin/}"
-               echo "X-Git-Refname: $BRANCH"
-               if [ -z "$BRANCH" ] || [ "$BRANCH" = "master" ]
-               then
-                       BRANCH=""
-               else
-                       BRANCH="/$BRANCH"
-               fi
-               git log -1 --format="Subject: [git: $REPOS$BRANCH][$STATUS] %s"
-               echo "To: $1"
-               echo "Date: $(LC_ALL=C date '+%a, %e %b %Y %T %z (%Z)')"
-               echo "X-Git-Repository: $REPOS"
-               git log -2 --format="X-Git-Oldrev: %H"
-               git log -1 --format="X-Git-Newrev: %H"
-               echo
-               uname -a
-               echo
-               echo "$CI_URI"
-               echo
-               # -------------------------------------------------------------
-               # ----  Repository specific reporting part
-               # ----
-                       ( cd test; $TPKG report )
-               # ----
-               # -------------------------------------------------------------
-       ) | sendmail "$1"
-       shift
- done
- test "$STATUS" = "pass"
+ cd test
 -exec $TPKG -n -1 r
 -
++exec $TPKG -n -1 r