8 testname="${DGIT_TEST_TESTNAME-${0##*/}}"
11 if [ x"$tmp" = x ]; then
13 tmp=tests/tmp/$testname
21 export DGIT_TEST_DUMMY_DIR=$tmp
25 cp $troot/gnupg/* $tmp/gnupg
26 chmod go-rw $tmp/gnupg/*
27 export GNUPGHOME=$tmp/gnupg
29 mkdir -p $tmp/incoming
30 cat <<END >$tmp/dput.cf
33 incoming = $tmp/incoming
44 local edittree=$1.edit
45 if test -d "$edittree"; then
46 cp -al "$edittree"/* .
54 t-untar $troot/worktrees/${p}_$1
61 local gs=$troot/git-srcs/${p}_$v.git
62 (set -e; cd $tmp/git; t-untar $gs)
67 (set -e; cd $tmp/git; tar xf $troot/git-template.tar)
71 local now=`git rev-parse HEAD`
72 local ancestor=`git rev-parse $1^{}`
73 local mbase=`git merge-base $ancestor $now`
74 if [ x$mbase != x$ancestor ]; then
75 fail "not ff $ancestor..$now, $mbase != $ancestor"
81 mkdir -p $tmp/aq $tmp/mirror
82 echo sid >$tmp/aq/suite.unstable
88 local dscf=${p}_$2.dsc
89 rm -f $tmp/mirror/${p}_*
90 ln $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/
91 echo "$2 $dscf" >>$tmp/aq/package.sid.${p}
94 (set -e; cd $tmp/extract; dpkg-source -x ../mirror/$dscf)
100 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
101 ${DGIT_TEST-dgit} --dget:-u --dput:--config=$tmp/dput.cf \
102 -dtest-dummy $DGIT_TEST_OPTS ${DGIT_TEST_DEBUG--D} \
104 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
109 diff --exclude=.git -ruN $*
112 t-cloned-fetched-good () {
113 t-diff-nogit ../extract/$p-${v%-*} .
114 t-clean-on-branch dgit/sid
117 refs/heads/dgit/sid \
118 refs/remotes/dgit/dgit/sid
119 t-refs-notexist dgit/unstable remotes/dgit/dgit/unstable
123 printf "%s\n" "$1" >$tmp/t.want
126 diff $tmp/t.want $tmp/t.got
129 t-clean-on-branch () {
130 t-output "## $1" git status -b --porcelain
135 git show-ref -d $1 | perl -ne '
136 $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
137 END { print "$x\n" if length $x; }
143 local val=`t-git-get-ref $name`
144 t-ref-same-val "$name" $val
148 local val=`git rev-parse HEAD`
149 t-ref-same-val HEAD $val
158 *) fail "ref varies: $name: $val != $t_ref_val" ;;
163 t-refs-same-start () {
177 val=`t-git-get-ref $g >$tmp/t.refx`
178 if [ "x$val" != x ]; then
179 fail "ref $g unexpectedly exists ($val)"
185 echo refs/tags/debian/${v//\~/_}
194 refs/remotes/dgit/dgit/sid
196 refs/heads/dgit/unstable \
197 refs/remotes/dgit/dgit/unstable
198 (set -e; cd $tmp/git/$p.git
205 git verify-tag `t-v-tag`
212 use Dpkg::Control::Hash;
213 my $h = new Dpkg::Control::Hash allow_pgp=>1;
214 $h->parse(\*STDIN,"'"$file"'");
215 my $val = $h->{"'$field'"},"\n";
216 die "'"$file $field"'" unless defined $val;
222 local dsc=${p}_${v}.dsc
223 local val=`t-822-field $tmp/incoming/$dsc Dgit`
224 perl -e '$_=shift @ARGV; die "$dsc Dgit $_ ?" unless m/^\w+\b/;' "$val"
225 t-ref-same-val $dsc "$val"
231 (cd $troot/pkg-srcs; debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc) \
236 git config --global "$@"
240 export DGIT_TEST_TROOT=$troot
241 export DGIT_TEST_TMP=$tmp
242 t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
243 t-git-config dgit-distro.test-dummy.git-check true
244 t-git-config dgit-distro.test-dummy.git-create true
245 cp $root/tests/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
246 cp $root/tests/suites $tmp/.
252 export DGIT_TEST_TESTNAME="$testname"
254 exec "${0///drs-//}" "$@"