7 # This test script tests each of the split brain quilt modes, and
8 # --quilt=linear, with a tree suitable for each of those, and pushes
9 # them in sequence. The idea is to check that each tree is rejected
10 # by the wrong quilt modes, and accepted and processed correctly by
13 t-tstunt-parsechangelog
15 # Easiest way to make a patches-unapplied but not-gbp tree is
16 # to take the patches-unapplied tree and by-hand commit the .gitignore
17 # changes as a debian patch.
27 t-dgit "$@" --quilt=$qmode --dgit-view-save=split.b build-source
29 t-dgit "$@" --quilt=$qmode --dgit-view-save=split.p push
30 t-$qmode-pushed-good $suite
34 echo "===== testing tree suitable for --quilt=gbp (only) ====="
36 t-expect-fail 'git tree differs from result of applying' \
37 t-dgit -wgf --quilt=dpm build-source
39 t-expect-fail 'git tree differs from orig in upstream files' \
40 t-dgit -wgf --quilt=unapplied build-source
42 t-expect-fail 'This might be a patches-unapplied branch' \
43 t-dgit -wgf build-source
45 # testing success with --quilt=gbp are done in quilt-gbp test case
48 echo "===== making tree suitable for --quilt=unapplied (only) ====="
50 pf=debian/patches/test-gitignore
53 From: Senatus <spqr@example.com>
54 Subject: Add .gitignore
59 git diff /dev/null .gitignore >>$pf || test $? = 1
60 echo ${pf##*/} >>debian/patches/series
62 git add debian/patches
64 git commit -m 'Turn gitignore into a debian patch'
65 gitigncommit=`git rev-parse HEAD`
67 t-commit unapplied 1.0-3
69 echo "----- testing tree suitable for --quilt=unapplied (only) -----"
71 t-expect-fail 'git tree differs from result of applying' \
72 t-dgit -wgf --quilt=dpm build-source
74 t-expect-fail 'gitignores: but, such patches exist' \
75 t-dgit -wgf --quilt=gbp build-source
77 t-expect-fail 'This might be a patches-unapplied branch' \
78 t-dgit -wgf build-source
80 want-success unapplied -wgf
83 echo "===== making fully-applied tree suitable for --quilt-check ====="
86 git merge --ff-only dgit/dgit/sid
88 t-commit vanilla 1.0-4
90 echo "----- testing fully-applied tree suitable for --quilt-check -----"
92 t-expect-fail 'gitignores: but, such patches exist' \
93 t-dgit --quilt=dpm build-source
95 t-expect-fail 'git tree differs from orig in upstream files' \
96 t-dgit --quilt=gbp build-source
98 t-expect-fail 'git tree differs from orig in upstream files' \
99 t-dgit --quilt=unapplied build-source
101 t-dgit --quilt=nofix build-source
104 t-dgit --quilt=nofix push
108 echo "===== making tree suitable for --quilt=dpm (only) ====="
111 git merge --ff-only dgit/dgit/sid
113 git revert --no-edit $gitigncommit
115 t-commit dpmish 1.0-5
117 echo "----- testing tree suitable for --quilt=dpm (only) -----"
119 t-expect-fail 'git tree differs from orig in upstream files' \
120 t-dgit -wgf --quilt=gbp build-source
122 t-expect-fail 'git tree differs from orig in upstream files' \
123 t-dgit -wgf --quilt=unapplied build-source
125 t-expect-fail 'This might be a patches-applied branch' \
126 t-dgit -wgf build-source
131 t-commit dpmish-stable 1.0-6 $suite
133 want-success dpm --new