chiark / gitweb /
test suite: default dsc distro config setting: Move to lib.
[dgit.git] / tests / lib
index 4f6f3078a9d15e099e86e47952670ac5f4f35637..7b9de175155708bf979ccf036453d1b0d6d3dbb3 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -28,6 +28,8 @@ t-set-intree
 : ${DGIT_TEST_DEBUG=-D}
 export DGIT_TEST_DEBUG
 
+: ${DGIT_TEST_DISTRO+ ${distro=${DGIT_TEST_DISTRO}}}
+
 export GIT_COMMITTER_DATE='1440253867 +0100'
 export GIT_AUTHOR_DATE='1440253867 +0100'
 
@@ -51,6 +53,7 @@ tmp=`pwd`
 
 t-set-using-tmp
 
+test -f $tmp/.save-env || \
 env -0 >$tmp/.save-env
 
 ln -f $troot/ssh ssh
@@ -392,6 +395,7 @@ t-fscks () {
 }
 
 t-ok () {
+       : '========================================'
        t-fscks
        echo ok.
 }
@@ -406,7 +410,7 @@ t-dgit () {
        : '
 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
        $dgit --dgit=$dgit --dget:-u --dput:--config=$tmp/dput.cf \
              --config-lookup-explode=dgit-distro.debian.alias-canon \
${dgit_config_debian_alias-"--config-lookup-explode=dgit-distro.debian.alias-canon"} \
                ${distro--dtest-dummy} ${distro+${distro:+-d}${distro}} \
                $DGIT_TEST_OPTS $DGIT_TEST_DEBUG \
                -k39B13D8A $t_dgit_xopts "$@"
@@ -777,6 +781,11 @@ t-822-field () {
        ' <$file
 }
 
+t-defdistro () {
+       export DGIT_TEST_DISTRO=''
+       t-git-config dgit-suite.unstable.distro test-dummy
+}
+
 t-stunt-envvar () {
        local var=$1
        local tstunt=$2
@@ -800,7 +809,14 @@ t-tstunt--save-real () {
        local rc
        local real
        set +e
-       real=$(type -p "$f")
+       real=$(
+               p=":$PATH:"
+               p="${p/:"$tmp/tstunt":/:}"
+               p="${p%:}"
+               p="${p#:}"
+               PATH="$p"
+               type -p "$f"
+       )
        rc=$?
        set -e
 
@@ -1008,7 +1024,9 @@ t-dsd () {
 }
 
 t-policy-admin () {
+       : '(((((((((((((((((((((((((((((((((((((((('
        ${DGIT_INFRA_PFX}dgit-repos-admin-debian --repos $tmp/git "$@"
+       : '))))))))))))))))))))))))))))))))))))))))'
 }
 
 t-policy-nonexist () {
@@ -1040,8 +1058,10 @@ t-debpolicy () {
 }
 
 t-policy-periodic () {
+       : '(((((((((((((((((((((((((((((((((((((((('
        ${DGIT_REPOS_SERVER_TEST-dgit-repos-server} \
                test-dummy $drs_dispatch '' --cron
+       : '))))))))))))))))))))))))))))))))))))))))'
 }
 
 t-restrict () {
@@ -1069,6 +1089,8 @@ t-alt-test () {
        t-chain-test "${t#*-}"
 }
 
+t-git-config dgit.default.old-dsc-distro test-dummy
+
 case "$0" in
 */gnupg) ;;
 *)     t-setup-import gnupg    ;;