]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
add a testcase for support of various build-dependency types
[apt.git] / test / integration / framework
index 243996e141b59f4bd9d2b820087ac428f2305281..d5b68da84bad47c20c2140f2b911ec4db52c0af8 100644 (file)
@@ -5,6 +5,8 @@ EXIT_CODE=0
 while [ -n "$1" ]; do
        if [ "$1" = "-q" ]; then
                export MSGLEVEL=2
+       elif [ "$1" = "-qq" ]; then
+               export MSGLEVEL=1
        elif [ "$1" = "-v" ]; then
                export MSGLEVEL=4
        elif [ "$1" = '--color=no' ]; then
@@ -142,6 +144,9 @@ if [ $MSGLEVEL -le 4 ]; then
        msgdebug() { true; }
        msgndebug() { true; }
 fi
+if [ $MSGLEVEL -le 1 ]; then
+       msgpass() { true; }
+fi
 msgdone() {
        if [ "$1" = "debug" -a $MSGLEVEL -le 4 ] ||
           [ "$1" = "info" -a $MSGLEVEL -le 3 ] ||
@@ -520,18 +525,20 @@ configdpkg() {
                local STATUSFILE="status-${BASENAME#*-}"
                if [ -f "${TESTDIRECTORY}/${STATUSFILE}" ]; then
                        cp "${TESTDIRECTORY}/${STATUSFILE}" rootdir/var/lib/dpkg/status
+                       # Add an empty line to the end if there is none
+                       if tail -1 rootdir/var/lib/dpkg/status | grep -q .; then
+                               echo >> rootdir/var/lib/dpkg/status
+                       fi
                else
                        echo -n > rootdir/var/lib/dpkg/status
                fi
        fi
        rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg
-       # if multi-arch make sure dpkg can detect itself as capable of it
-       if getarchitectures | grep -E -q '[^ ]+ [^ ]+'; then
-               if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then
-                       # dpkg doesn't really check the version as long as it is fully installed,
-                       # but just to be sure we choose one above the required version
-                       insertinstalledpackage 'dpkg' "all" '1.16.2+fake'
-               fi
+       # make sure dpkg can detect itself as capable of it
+       if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then
+               # dpkg doesn't really check the version as long as it is fully installed,
+               # but just to be sure we choose one above the required version
+               insertinstalledpackage 'dpkg' "all" '1.16.2+fake'
        fi
        if dpkg --assert-multi-arch >/dev/null 2>&1 ; then
                local ARCHS="$(getarchitectures)"
@@ -808,7 +815,7 @@ buildpackage() {
        if [ "$ARCH" = "all" ]; then
                ARCH="$(dpkg-architecture -qDEB_HOST_ARCH 2> /dev/null)"
        fi
-       testsuccess --nomsg dpkg-buildpackage -uc -us -a$ARCH
+       testsuccess --nomsg dpkg-buildpackage -uc -us -a$ARCH -d
        cp "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "$BUILDLOG"
        local PKGS="$(grep '^dpkg-deb: building package' "$BUILDLOG" | cut -d'/' -f 2 | sed -e "s#'\.##")"
        local SRCS="$(grep '^dpkg-source: info: building' "$BUILDLOG" | grep -o '[a-z0-9._+~-]*$')"