chiark / gitweb /
test suite: Drop all testing of old tag formats, and compatibility
[dgit.git] / tests / tests / quilt-gbp
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 # `dgit build-source` cleans before applying patches.  However, the
6 # clean targets of 3.0 (quilt) packages are allowed to assume that
7 # patches are applied.  If they are not, the clean targets can
8 # misbehave in basically two ways:
9 #
10 # - fail to clean everything
11 # - error out and stop the build
12 #
13 # In this test, what we want to see is whether dgit detects that quilt
14 # fixup cannot be linear because the user has failed to pass --gbp.
15 # So we need to ensure the package's clean target does not error out,
16 # because that blocks dgit attempting quilt linearisation.  This
17 # environment variable tells the example package's clean target not to
18 # error out if it notices that patches have not yet been applied.
19 export DGIT_TEST_TOLERATE_UNPATCHED_CLEAN=true
20
21 t-tstunt-parsechangelog
22
23 t-gbp-example-prep
24
25 t-expect-fail 'quilt fixup cannot be linear' \
26   t-dgit build-source
27
28 t-dgit --quilt=gbp --dgit-view-save=split.b1 build-source
29 git rev-parse split.b1
30
31 t-dgit --quilt=gbp --gbp-pq=no-such-command-gbp build-source
32
33 echo spong >debian/pointless-for-dgit-test
34 git add debian/pointless-for-dgit-test
35 git commit -m Pointless
36
37 t-expect-fail no-such-command-gbp \
38 t-dgit --quilt=gbp --clean=git --gbp-pq=no-such-command-gbp build-source
39
40 test-push-1 () {
41         t-refs-same-start
42         t-ref-head
43 }
44
45 test-push-2 () {
46         t-dgit --quilt=gbp --dgit-view-save=split.p push
47
48         t-gbp-pushed-good
49 }
50
51 test-push-1
52
53 t-dgit --quilt=gbp --clean=git --dgit-view-save=split.b build-source
54
55 t-expect-fail "HEAD specifies a different tree to $p" \
56   t-dgit push
57
58 test-push-2
59
60 echo wombat >>debian/pointless-for-dgit-test
61 git add debian/pointless-for-dgit-test
62 git commit -m 'Pointless 2'
63
64 t-commit 'Check pseudomerge' 1.0-3
65
66 test-push-1
67
68 t-dgit --quilt=gbp --clean=git --dgit-view-save=split.b build-source
69
70 test-push-2
71
72 t-ok