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
85 t-archive-process-incoming () {
86 mv incoming/${p}_${v}[._]* mirror/
91 local dscf=${p}_${v}.dsc
92 echo "${v} $dscf" >>$tmp/aq/package.sid.${p}
98 local dscf=${p}_$2.dsc
99 rm -f $tmp/mirror/${p}_*
100 ln $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/
104 (set -e; cd $tmp/extract; dpkg-source -x ../mirror/$dscf)
108 local dgit=${DGIT_TEST-dgit}
110 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
111 $dgit --dgit=$dgit --dget:-u --dput:--config=$tmp/dput.cf \
112 -dtest-dummy $DGIT_TEST_OPTS ${DGIT_TEST_DEBUG--D} \
114 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
119 diff --exclude=.git --exclude=.pc -ruN $*
122 t-cloned-fetched-good () {
123 t-diff-nogit ../extract/$p-${v%-*} .
124 t-clean-on-branch dgit/sid
127 refs/heads/dgit/sid \
128 refs/remotes/dgit/dgit/sid
129 t-refs-notexist dgit/unstable remotes/dgit/dgit/unstable
133 printf "%s\n" "$1" >$tmp/t.want
136 diff $tmp/t.want $tmp/t.got
139 t-clean-on-branch () {
140 t-output "## $1" git status -b --porcelain
145 git show-ref -d $1 | perl -ne '
146 $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
147 END { print "$x\n" if length $x; }
153 local val=`t-git-get-ref $name`
154 t-ref-same-val "$name" $val
158 local val=`git rev-parse HEAD`
159 t-ref-same-val HEAD $val
168 *) fail "ref varies: $name: $val != $t_ref_val" ;;
173 t-refs-same-start () {
187 val=`t-git-get-ref $g >$tmp/t.refx`
188 if [ "x$val" != x ]; then
189 fail "ref $g unexpectedly exists ($val)"
195 echo refs/tags/debian/${v//\~/_}
204 refs/remotes/dgit/dgit/sid
206 refs/heads/dgit/unstable \
207 refs/remotes/dgit/dgit/unstable
208 (set -e; cd $tmp/git/$p.git
215 git verify-tag `t-v-tag`
222 use Dpkg::Control::Hash;
223 my $h = new Dpkg::Control::Hash allow_pgp=>1;
224 $h->parse(\*STDIN,"'"$file"'");
225 my $val = $h->{"'$field'"},"\n";
226 die "'"$file $field"'" unless defined $val;
232 local dsc=${p}_${v}.dsc
233 local val=`t-822-field $tmp/incoming/$dsc Dgit`
234 perl -e '$_=shift @ARGV; die "$dsc Dgit $_ ?" unless m/^\w+\b/;' "$val"
235 t-ref-same-val $dsc "$val"
241 (cd $troot/pkg-srcs; debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc) \
246 git config --global "$@"
250 export DGIT_TEST_TROOT=$troot
251 export DGIT_TEST_TMP=$tmp
252 t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
253 t-git-config dgit-distro.test-dummy.git-check true
254 t-git-config dgit-distro.test-dummy.git-create true
255 cp $root/tests/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
256 cp $root/tests/suites $tmp/.
262 export DGIT_TEST_TESTNAME="$testname"
264 exec "${0///drs-//}" "$@"