chiark / gitweb /
Provide t-archive-process-incoming and t-archive-query subroutines for regression...
[dgit.git] / tests / lib
index dc0911b8140376775cabf432120889523d7d7868..5e64b99cd577b58bf6ddee4e4a421773a16be3ee 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -39,16 +39,27 @@ fail () {
        exit 1
 }
 
+t-untar () {
+       local tarfile=$1.tar
+       local edittree=$1.edit
+       if test -d "$edittree"; then
+               cp -al "$edittree"/* .
+       else
+               tar xf "$tarfile"
+       fi
+}
+
 t-worktree () {
        rm -rf $p
-       tar xf $troot/worktrees/${p}_$1.tar
+       t-untar $troot/worktrees/${p}_$1
 }
 
 t-git () {
        p=$1
        v=$2
        mkdir -p $tmp/git
-       (set -e; cd $tmp/git; tar xf $troot/git-srcs/${p}_$v.git.tar)
+       local gs=$troot/git-srcs/${p}_$v.git
+       (set -e; cd $tmp/git; t-untar $gs)
 }
 
 t-git-none () {
@@ -71,13 +82,23 @@ t-archive-none () {
        echo sid >$tmp/aq/suite.unstable
 }
 
+t-archive-process-incoming () {
+       mv incoming/${p}_${v}[._]* mirror/
+       t-archive-query
+}
+
+t-archive-query () {
+       local dscf=${p}_${v}.dsc
+       echo "${v} $dscf" >>$tmp/aq/package.sid.${p}
+}
+
 t-archive () {
        t-archive-none $1
        v=$2
        local dscf=${p}_$2.dsc
        rm -f $tmp/mirror/${p}_*
        ln $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/
-       echo "$2 $dscf" >>$tmp/aq/package.sid.${p}
+       t-archive-query
        rm -rf $tmp/extract
        mkdir $tmp/extract
        (set -e; cd $tmp/extract; dpkg-source -x ../mirror/$dscf)
@@ -88,7 +109,8 @@ t-dgit () {
 
 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
        ${DGIT_TEST-dgit} --dget:-u --dput:--config=$tmp/dput.cf \
-               -dtest-dummy $DGIT_TEST_OPTS -D -k39B13D8A "$@"
+               -dtest-dummy $DGIT_TEST_OPTS ${DGIT_TEST_DEBUG--D} \
+               -k39B13D8A "$@"
        : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
 '
 }
@@ -227,9 +249,11 @@ t-git-config () {
 t-drs () {
        export DGIT_TEST_TROOT=$troot
        export DGIT_TEST_TMP=$tmp
-       t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext "
-       t-git-config dgit-distro.test-dummy.git-check true
-       t-git-config dgit-distro.test-dummy.git-create true
+ t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
+ t-git-config dgit-distro.test-dummy.git-check true
+ t-git-config dgit-distro.test-dummy.git-create true
+       cp $root/tests/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
+       cp $root/tests/suites $tmp/.
 }
 
 t-drs-test () {
@@ -239,4 +263,3 @@ t-drs-test () {
        export ADTTMP=$tmp
        exec "${0///drs-//}" "$@"
 }
-