5 t-dependencies bsdgames
6 t-dependencies man-db git-man
7 t-tstunt-parsechangelog
14 : ----- prepare badnesses -----
21 echo >>af/$filename "Test file with $attrspec"
22 printf >>af/$filename 'crlf: \r\n'
23 echo >>af/$filename 'id $Id: $'
24 echo >>af/$filename 'id $Id: SPLARK $'
25 echo >>gitattrs "af/$filename" "$attrspec"
30 badattr1 $attrname-set $attrname
31 badattr1 $attrname-unset -$attrname
32 badattr1 $attrname-unspec \!$attrname
35 badattr1 $attrname=$val $attrname=$val
39 # xxx want to make each of these files into a quilt patch
41 t-git-config core.eol crlf
47 t-git-config filter.dgit-test-crazy-f.smudge '/usr/games/rot13 2'
48 t-git-config filter.dgit-test-crazy-f.clean '/usr/games/rot13 24'
49 t-git-config filter.dgit-test-crazy-f.requrired true
51 badattr filter dgit-test-crazy-f
54 badattr merge text binary union
59 badattr encoding no-such-encoding
62 | perl -ne 'print $1,"\n" if m/^ *(\w[-a-z]*)$/' \
72 # ----- common to source formats -----
80 local addpatch=${sfmt}_addpatch
81 local convert=${sfmt}_convert
92 cp ../gitattrs .gitattributes
107 # caller should cd into working directory, set
109 # and check out $branch
111 sha256sum af/* >../$sums.checkout
112 diff -U0 ../sums ../$sums.checkout
115 git cat-file blob "refs/heads/$branch:$f" \
117 | sed -e 's#-$#'$f'#' \
121 diff -U0 ../sums ../$sums
124 sums_check_broken () {
125 # caller should cd into working directory, set
127 # and check out the broken branch
129 sha256sum af/* >../$sums.broken
131 for s in ../sums ../$sums.broken; do
132 sed 's/[0-9a-f]* //' $s >$s.nosums
134 diff -U0 ../sums.nosums ../$sums.broken.nosums
136 diff -U0 ../sums ../$sums.broken
142 t-dgit-warn-check () {
143 local warnok=$1; shift
144 # warnok should be 0 if the warning is expected
145 # 1 if the warning is NOT expected
149 LC_MESSAGES=C t-dgit "$@" 2>&1 |tee ../$err
152 egrep 'warning: .* contains \.gitattributes' ../$err
156 test "$rc" = "$warnok"
162 branch="import.$sfmt-$inst"
164 sums=sums.$sfmt-$inst
171 t-dgit-warn-check 0 $dgitargs import-dsc ../$dscf +$branch.broken
173 git checkout $branch.broken
177 t-dgit setup-new-tree
179 t-dgit-warn-check 1 $dgitargs import-dsc ../$dscf +$branch
189 : ----- generate the orig -----
191 origtar=${p}_${bv}.orig.tar.gz
193 tar --exclude=debian --exclude=.git -zcf $origtar $p
195 : ----- test 1.0 native -----
197 native_addpatch () { :; }
198 native_convert () { :; }
200 sfmt_setup 1.1 native
203 : ----- test 1.0 diff -----
205 diff_addpatch () { :; }
206 diff_convert () { :; }
211 : ----- test "3.0 (quilt)" -----
215 cat >../editor.pl <<END
217 s{^(description:).*}{\$1 dgit test patch $pname}i;
220 EDITOR="perl -pi $tmp/editor.pl" dpkg-source -iX --commit . $pname
221 test -f debian/patches/$pname
225 mkdir -p debian/source
226 echo '3.0 (quilt)' >debian/source/format
229 sfmt_setup 1.0-1 quilt
231 sfmt_import absurd --force-import-gitapply-absurd
233 : ----- 'test clone (with "3.0 (quilt)")' -----
235 mv $origtar ${dscf%.dsc}.* $tmp/mirror/pool/main/
238 t-dgit-warn-check 0 -cdgit.default.setup-gitattributes=false \
239 clone $p sid $p.clone.broken
247 t-dgit-warn-check 1 clone $p sid $p.clone