X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=tests%2Flib;h=f6f4e2944eea6a50b1b06f860741801b2de57435;hp=dc0911b8140376775cabf432120889523d7d7868;hb=f4bf99af68ee0a64848bd43869e90d65d60800f2;hpb=4e035e6deb0c676422c6bd91f89ae5b8cad985cb diff --git a/tests/lib b/tests/lib index dc0911b8..f6f4e294 100644 --- 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 () { @@ -227,9 +238,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 +252,3 @@ t-drs-test () { export ADTTMP=$tmp exec "${0///drs-//}" "$@" } -