chiark / gitweb /
test suite: Work if $tmp is on a different filesystem.
[dgit.git] / tests / lib-gdr
index 9d9fcb461a09025a173f8dc8d23af0b5ee2a8fc5..cda11df5b8d5fe7d322d9f8f8168cc44c2554746 100644 (file)
@@ -3,6 +3,8 @@
 : ${GDR_TEST_DEBUG=-D}
 export GDR_TEST_DEBUG
 
+t-tstunt debchange
+
 t-git-debrebase () {
        local gdr=${DGIT_GITDEBREBASE_TEST-git-debrebase}
        : '
@@ -21,14 +23,20 @@ t-gdr-good () {
        #   stitched
        #   pushed
 
+       case $state in
+       pushed*)
+               t-gdr-made-patches
+               ;;
+       esac
+
        git diff --quiet ${beforetag-t.before} -- ':.' ':!debian/patches'
 
        LC_MESSAGES=C t-git-debrebase status >../status.check
        case $state in
-       laundered)
+       laundered*)
                egrep '^  *branch is laundered' ../status.check
                ;;
-       stitched|pushed)
+       stitched*|pushed*)
                egrep \
  '^  *branch contains furniture|^  *branch is unlaundered|^  *branch needs laundering' ../status.check
                egrep '^  stitched$' ../status.check
@@ -57,6 +65,7 @@ t-gdr-good-analyse () {
        pushed)         etypes=AddPatches-Pseudomerge-Upstream ;;
        pushed-interop) etypes=Pseudomerge-AddPatchesInterop-Upstream ;;
        breakwater)     etypes=Packaging ;;
+       *)              fail-unknown-state-$state ;;
        esac
 
        anal=../anal$wsfx
@@ -220,11 +229,9 @@ t-some-changes () {
 t-make-new-upstream-tarball () {
        local uv=$1
        git checkout make-upstream
-       # leaves ust set to filename of orig tarball
        echo "upstream $uv" >>docs/README
        git commit -a -m "upstream $uv tarball"
-       ust=example_$uv.orig.tar.gz
-       git archive -o ../$ust --prefix=example-2.0/ make-upstream
+       t-make-orig example $uv make-upstream
 }
 
 t-nmu-upload-1 () {
@@ -329,3 +336,42 @@ t-gdr-prep-new-upstream () {
        git checkout master
        t-git-next-date
 }
+
+t-gdr-gbp-import-core () {
+       p=example
+       t-worktree 1.1
+
+       cd example
+
+       : 'fake up some kind of upstream'
+       git checkout -b upstream quilt-tip
+       rm -rf debian
+       mkdir debian
+       echo junk >debian/rules
+       git add debian
+       git commit -m "an upstream retcon ($0)"
+       git tag v1.0
+}
+
+t-gdr-gbp-import-core-with-queue () {
+       t-gdr-gbp-import-core
+
+       : 'fake up that our quilt-tip was descended from upstream'
+       git checkout quilt-tip
+       git merge --no-edit -s ours upstream
+
+       : 'fake up that our quilt-tip had the patch queue in it'
+       git checkout patch-queue/quilt-tip
+       gbp pq export
+       git add debian/patches
+       git commit -m "patch queue update ($0)"
+
+       : 'make branch names more conventional'
+       git branch -D master
+       git branch -m quilt-tip master
+}
+
+t-gdr-made-patches () {
+       git log -n1 --'pretty=format:%B' \
+       | egrep '^\[git-debrebase'
+}