chiark / gitweb /
import-maintmangle: New test for changelog Maintainer mangling.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Feb 2017 20:34:40 +0000 (20:34 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Feb 2017 20:47:19 +0000 (20:47 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
debian/tests/control
tests/tests/import-maintmangle [new file with mode: 0755]

index 2269201..d333d89 100644 (file)
@@ -13,6 +13,7 @@ dgit (3.10~) unstable; urgency=medium
   * quilt-useremail: New test for user config copying (#853085).
   * lib-import-chk: Test that commits have smae authorship as appears in
     the changelog.  (Or, at least, the same authorship set.)
+  * import-maintmangle: New test for changelog Maintainer mangling.
 
  --
 
index e3f768d..0df610e 100644 (file)
@@ -29,7 +29,7 @@ Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential
 Restrictions: x-dgit-git-only
 
-Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig import-dsc import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version protocol-compat push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt
+Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version protocol-compat push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential
 
diff --git a/tests/tests/import-maintmangle b/tests/tests/import-maintmangle
new file mode 100755 (executable)
index 0000000..31a5f88
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+set -e
+. tests/lib
+. $troot/lib-import-chk
+
+t-tstunt-parsechangelog
+
+t-select-package example
+v=1.0
+t-worktree $v
+
+cd $p
+
+dsc=${p}_${v}.dsc
+
+chk () {
+       local perl="$1"
+       local unperl="$2"
+       git checkout master~0
+       perl -i -pe "next unless m/^ -- /; $perl" debian/changelog
+       git commit --allow-empty -a -m "perl $perl"
+       (cd ..; dpkg-source -i\.git -I.git -b $p)
+       t-dgit import-dsc ../$dsc +x
+       git checkout x~0
+       t-import-chk-authorship
+}
+
+massage () {
+       perl -i~ -pe "$unperl" "$1"
+}
+
+import_chk_changelog_massage=massage
+
+chk
+
+chk    's/Ian Jackson/Ian Jackson, SPQR/' \
+       's/Ian Jackson, SPQR/Ian Jackson SPQR/'
+
+chk    's/Ian Jackson/"Ian Jackson, SPQR"/'
+
+t-ok