chiark / gitweb /
Test suite: quilt-splitbrains: Rename
[dgit.git] / tests / tests / quilt-splitbrains
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-tstunt-parsechangelog
6
7 t-newtag
8
9 # Easiest way to make a patches-unapplied but not-gbp tree is
10 # to take the patches-unapplied tree and by-hand commit the .gitignore
11 # changes as a debian patch.
12 t-gbp-example-prep
13
14 suite=sid
15
16 want-success () {
17         local qmode=$1; shift
18         t-dgit "$@" --quilt=$qmode build-source
19
20         t-refs-same-start
21         t-ref-head
22         t-dgit "$@" --quilt=$qmode push
23         t-$qmode-pushed-good
24 }
25
26
27 echo "===== testing tree suitable for --quilt=gbp (only) ====="
28
29 t-expect-fail 'grep: new-upstream-file: No such file or directory' \
30 t-dgit --quilt=dpm build-source
31
32 t-expect-fail 'git tree differs from result of applying' \
33 t-dgit -wgf --quilt=dpm build-source
34
35 t-expect-fail 'git tree differs from orig in upstream files' \
36 t-dgit -wgf --quilt=unapplied build-source
37
38 t-expect-fail 'This might be a patches-unapplied branch' \
39 t-dgit -wgf build-source
40
41 # testing success with --quilt=gbp are done in quilt-gbp test case
42
43
44 echo "===== making tree suitable for --quilt=unapplied (only) ====="
45
46 pf=debian/patches/test-gitignore
47
48 cat >$pf <<END
49 From: Senatus <spqr@example.com>
50 Subject: Add .gitignore
51
52 ---
53 END
54
55 git-diff /dev/null .gitignore >>$pf || test $? = 1
56 echo ${pf##*/} >>debian/patches/series
57
58 git add debian/patches
59 git rm -f .gitignore
60 git commit -m 'Turn gitignore into a debian patch'
61 gitigncommit=`git rev-parse HEAD`
62
63 t-commit unapplied 1.0-3
64
65 echo "----- testing tree suitable for --quilt=unapplied (only) -----"
66
67 t-expect-fail 'git tree differs from result of applying' \
68 t-dgit -wgf --quilt=dpm build-source
69
70 t-expect-fail 'gitignores: but, such patches exist' \
71 t-dgit -wgf --quilt=gbp build-source
72
73 t-expect-fail 'This might be a patches-unapplied branch' \
74 t-dgit -wgf build-source
75
76 want-success unapplied -wgf
77
78
79 echo "===== making fully-applied tree suitable for --quilt-check ====="
80
81 git checkout master
82 git merge --ff-only dgit/dgit/sid
83
84 t-commit vanilla 1.0-4
85
86 echo "----- testing fully-applied tree suitable for --quilt-check -----"
87
88 t-expect-fail 'gitignores: but, such patches exist' \
89 t-dgit --quilt=dpm build-source
90
91 t-expect-fail 'git tree differs from orig in upstream files' \
92 t-dgit --quilt=gbp build-source
93
94 t-expect-fail 'git tree differs from orig in upstream files' \
95 t-dgit --quilt=unapplied build-source
96
97 t-dgit --quilt=nofix build-source
98 t-refs-same-start
99 t-ref-head
100 t-dgit --quilt=nofix push
101 t-pushed-good-core
102
103
104 echo "===== making tree suitable for --quilt=dpm (only) ====="
105
106 git checkout master
107 git merge --ff-only dgit/dgit/sid
108
109 git revert --no-edit $gitigncommit
110
111 t-commit dpmish 1.0-5
112
113 echo "----- testing tree suitable for --quilt=dpm (only) -----"
114
115 t-expect-fail 'git tree differs from orig in upstream files' \
116 t-dgit -wgf --quilt=gbp build-source
117
118 t-expect-fail 'git tree differs from orig in upstream files' \
119 t-dgit -wgf --quilt=unapplied build-source
120
121 t-expect-fail 'This might be a patches-applied branch' \
122 t-dgit -wgf build-source
123
124 want-success dpm
125
126
127 echo ok.