chiark / gitweb /
Test suite: import-quilt: Initial version of new test case
[dgit.git] / tests / tests / import-quilt
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-tstunt-parsechangelog
6
7 chk () {
8         p=$1
9         v=$2
10
11         t-archive $p $v
12         t-git-none
13         t-dgit --no-rm-on-error clone $p
14
15         echo xxx do some basic checks
16
17         # And now we make an update using the same orig tarball, and
18         # check that the orig import is stable.
19
20         cd $p
21
22         git branch first-import
23
24         m='Commit for import check'
25         echo "$m" >>import-check
26
27         v=${v%-*}-99
28         dch -v $v -D unstable -m "$m"
29
30         git add import-check debian/changelog
31         git commit -m "$m"
32
33         t-dgit -wgf quilt-fixup
34         t-dgit -wgf build-source
35
36         # The resulting .dsc does not have a Dgit line (because dgit push
37         # puts that in).  So we just shove it in the archive now
38
39         ln ../${p}_${v}.* $tmp/mirror/pool/main/
40         t-archive-query
41
42         t-dgit fetch
43
44         git branch first-2nd-import remotes/dgit/dgit/sid
45
46         export GIT_AUTHOR_DATE=1475947851
47         export GIT_COMMITTER_DATE=1475947851
48
49         t-dgit fetch
50
51         t-refs-same-start
52         t-ref-same refs/remotes/dgit/dgit/sid
53         t-ref-same refs/heads/first-2nd-import
54
55         for orig in ../${p}_${v%-*}.orig*.tar.*; do
56                 orig=${orig#../}
57                 pat="^Import ${orig//./\\.}\$"
58                 t-refs-same-start
59                 for start in first-import first-2nd-import; do
60                         git log --pretty='tformat:%H' --grep "$pat" $start \
61                                 >../t.imp
62                         test $(wc -l <../t.imp) = 1
63                         imp=$(cat ../t.imp)
64                         t-ref-same-val "$orig $start" "$imp"
65                 done
66         done
67         cd ..
68 }
69
70 chk example 1.0-1
71
72 chk sunxi-tools 1.2-2.~~dgittest
73
74 echo xxx need more.