diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib-import-chk | 13 | ||||
-rwxr-xr-x | tests/tests/import-maintmangle | 41 | ||||
-rwxr-xr-x | tests/tests/quilt-useremail | 27 |
3 files changed, 81 insertions, 0 deletions
diff --git a/tests/lib-import-chk b/tests/lib-import-chk index ee33cbe..88984c1 100644 --- a/tests/lib-import-chk +++ b/tests/lib-import-chk @@ -1,4 +1,15 @@ +t-import-chk-authorship () { + perl -ne 'print $1,"\n" if m/^ -- (\S.*\>) /' debian/changelog \ + | sort -u \ + > $tmp/authorship.changelog + ${import_chk_changelog_massage:-:} $tmp/authorship.changelog + git log --pretty=format:'%an <%ae>%n%cn <%ce>' \ + | sort -u \ + > $tmp/authorship.commits + diff $tmp/authorship.{changelog,commits} +} + t-import-chk1 () { p=$1 v=$2 @@ -15,6 +26,8 @@ t-import-chk2() { cd $p + t-import-chk-authorship + git branch first-import m='Commit for import check' diff --git a/tests/tests/import-maintmangle b/tests/tests/import-maintmangle new file mode 100755 index 0000000..31a5f88 --- /dev/null +++ b/tests/tests/import-maintmangle @@ -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 diff --git a/tests/tests/quilt-useremail b/tests/tests/quilt-useremail new file mode 100755 index 0000000..f079395 --- /dev/null +++ b/tests/tests/quilt-useremail @@ -0,0 +1,27 @@ +#!/bin/bash +set -e +. tests/lib + +t-tstunt-parsechangelog +t-archive example 1.0-1 +t-worktree 1.0 +t-git-none + +cd $p + +git checkout quilt-tip-2 + +t-dgit -wgf fetch + +oe=other.email@example.com +on='Hannibal Barca' + +git config --local user.email "$oe" +git config --local user.name "$on" + +t-dgit -wgf --quilt=smash quilt-fixup + +git show | fgrep "$oe" +git show | fgrep "$on" + +t-ok |