chiark / gitweb /
test suite: Test dgit calling git-debrebase on new debianisation
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 25 Aug 2018 12:37:21 +0000 (13:37 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 25 Aug 2018 12:53:09 +0000 (13:53 +0100)
Now all the cases in dgit's branch_is_gdr history walker are tested:

  DGIT_TEST_DEBUG=-DD tests/using-intree tests/run-all
  cat tests/tmp/*.log |perl -ne 'next unless s/^branch_is_gdr  \w+ //; print' |sort -u |less

Produces the same list as:

  git-grep 'branch_is_gdr  ' | perl -pe 's/^^dgit:\s+//' |sort |less

(With the list of gdr commit annotations the same as in the source.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/tests/control
tests/tests/gdr-fresh [new file with mode: 0755]

index a2c73dfaf18b798818b2c754aaf6a366c3a2f477..3051e87a1237e8332a24ee417783bb8f23d881c0 100644 (file)
@@ -16,6 +16,10 @@ Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc
 Restrictions: x-dgit-intree-only x-dgit-git-only
 
+Tests: gdr-fresh
+Tests-Directory: tests/tests
+Depends: chiark-utils-bin, devscripts, git-debrebase, git-buildpackage, faketime
+
 Tests: gdr-merge-conflicts
 Tests-Directory: tests/tests
 Depends: chiark-utils-bin, git-debrebase, git-buildpackage, faketime, quilt
diff --git a/tests/tests/gdr-fresh b/tests/tests/gdr-fresh
new file mode 100755 (executable)
index 0000000..b1e7390
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -e
+autoimport=
+. tests/lib
+. $troot/lib-gdr
+
+t-dependencies NO-DGIT devscripts GDR
+
+t-gdr-gbp-import-core
+
+t-git-next-date
+
+# leaves us on upstream
+git rm debian/rules
+git commit -m 'strip upstream rules'
+git tag -f v1.0
+
+git branch -m master master.old
+git checkout -b master
+
+t-git-next-date
+
+git checkout quilt-tip debian
+git commit -m 'initial debianisation'
+
+git-deborig
+
+dgit-quilt-fixup-uses-gdr () {
+       t-git-next-date
+
+       DGIT_TEST_DEBUG=-DD t-dgit quilt-fixup 2>&1 |tee ../fixup.out
+       grep '^branch_is_gdr  .* YES$' ../fixup.out
+}
+
+dgit-quilt-fixup-uses-gdr
+
+git checkout --detach patch-queue/quilt-tip
+git rebase master
+git push . HEAD:master
+git checkout master
+
+dgit-quilt-fixup-uses-gdr
+t-gdr-made-patches
+
+t-ok