chiark / gitweb /
infra/dgit-ssh-dispatch: New production infra script
[dgit.git] / tests / lib
index f6f4e2944eea6a50b1b06f860741801b2de57435..0073df4123e56ea48014c11e73be87184c42b057 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -3,6 +3,13 @@
 exec 2>&1
 set -x
 
+if [ "x$DGIT_TEST_INTREE" != x ]; then
+       : ${DGIT_TEST:=$DGIT_TEST_INTREE/dgit}
+       : ${DGIT_REPOS_SERVER_TEST:=$DGIT_TEST_INTREE/dgit-repos-server}
+       : ${DGIT_SSH_DISPATCH_TEST:=$DGIT_TEST_INTREE/infra/dgit-ssh-dispatch}
+       export DGIT_TEST DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST
+fi
+
 root=`pwd`
 troot=$root/tests
 testname="${DGIT_TEST_TESTNAME-${0##*/}}"
@@ -82,30 +89,41 @@ 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)
 }
 
 t-dgit () {
+       local dgit=${DGIT_TEST-dgit}
        : '
-
 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
-       ${DGIT_TEST-dgit} --dget:-u --dput:--config=$tmp/dput.cf \
-               -dtest-dummy $DGIT_TEST_OPTS -D -k39B13D8A "$@"
+       $dgit --dgit=$dgit --dget:-u --dput:--config=$tmp/dput.cf \
+               -dtest-dummy $DGIT_TEST_OPTS ${DGIT_TEST_DEBUG--D} \
+               -k39B13D8A "$@"
        : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
 '
 }
 
 t-diff-nogit () {
-       diff --exclude=.git -ruN $*
+       diff --exclude=.git --exclude=.pc -ruN $*
 }
 
 t-cloned-fetched-good () {
@@ -245,10 +263,17 @@ t-drs () {
        cp $root/tests/suites $tmp/.
 }
 
-t-drs-test () {
-       t-drs
+t-chain-test () {
+       local ct=$1
+       local d=${0%/*}
        cd $root
        export DGIT_TEST_TESTNAME="$testname"
        export ADTTMP=$tmp
-       exec "${0///drs-//}" "$@"
+       exec "$d/$ct"
+}      
+
+t-alt-test () {
+       local t=${0##*/}
+       t-${t%%-*}
+       t-chain-test "${t#*-}"
 }