chiark / gitweb /
test suite: tagupl: test one bad tag
[dgit.git] / tests / tests / tagupl
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-dependencies DEBORIG git-debpush
6
7 t-debpolicy
8
9 t-archive-none example
10 t-git-none
11 t-worktree 1.0
12
13 v=1.0-1
14
15 t-tagupl-settings
16
17 cd $p
18 git checkout -b native 
19
20 git checkout --orphan upstream quilt-tip-2
21 git rm -rf debian
22 git commit -m 'pseudo-upstream'
23 git tag upstream/1.0
24
25 git checkout -B master quilt-tip-2
26
27 upstream=$(git rev-parse upstream/1.0~0)
28 tagname=test-dummy/$v
29
30 t-tagupl-test --no-push --quilt=gbp
31
32 # xxx test pushing
33
34 # todo: test each miss/rejection
35
36 ident=ok
37
38 git cat-file tag $tagname >../basetag
39 v=1.0-2
40 tagname=test-dummy/$v
41
42 perl -i -ne '
43         next if $.==1../^$/;
44         next if m/^----/..0;
45         s/\b1\.0-1\b/1.0-2/g;
46         print or die $!;
47 ' ../basetag
48
49 with-mangled () {
50         local perl=$1
51         perl <../basetag >../badtag-$ident -pe "$perl"
52         git tag -u Senatus -f -s -m "$(cat ../badtag-$ident)" "$tagname"
53
54         t-tagupl-run-drs
55 }
56
57 expect-quit () {
58         mv ../tagupl/overall.log ../tagupl/overall.log-$ident
59         ident=$1
60         local perl=$2
61         local mstring=$3
62         with-mangled "$perl"
63         grep ": $mstring" ../tagupl/overall.log
64 }
65
66 expect-quit noplease s/please-upload/plunk/ 'tag missing please-upload'
67
68 t-ok