From 83c331e6033b40de9e52dc6552708e47f4aa5214 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 3 Aug 2017 12:22:33 +0100 Subject: [PATCH 1/1] test suite: dpkgsourceignores-correct: Test that the rune DTRT Signed-off-by: Ian Jackson --- debian/tests/control | 2 +- tests/tests/dpkgsourceignores-correct | 53 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100755 tests/tests/dpkgsourceignores-correct diff --git a/debian/tests/control b/debian/tests/control index efeeeed6..2590d043 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -34,7 +34,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 dpkgsourceignores-docs drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree 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: 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 dpkgsourceignores-correct dpkgsourceignores-docs drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree 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/dpkgsourceignores-correct b/tests/tests/dpkgsourceignores-correct new file mode 100755 index 00000000..33de95e8 --- /dev/null +++ b/tests/tests/dpkgsourceignores-correct @@ -0,0 +1,53 @@ +#!/bin/bash +set -e +. tests/lib + +t-tstunt-parsechangelog + +t-archive example 1.0-1 +t-git-none + +t-dgit --no-rm-on-error clone $p + +cd $p + +bad-dpkg-source () { + t-expect-fail E:"dpkg-source:.*unexpected upstream changes" \ + t-dgit --quilt=nofix -wgf build-source + find * -name .git -print0 | xargs -0r rm -- +} + +ignores=$(t-dgit print-dpkg-source-ignores) + +spurious-git-must-be-excluded () { + dpkg-source $ignores -b . + mkdir check + cd check + dpkg-source -x ../../${p}_${v}.dsc + cd ${p}-${v%-*} + find -name .git >../bad + diff /dev/null ../bad + cd ../.. + find * -name .git -print0 | xargs -0r rm -rf -- + git clean -xdff +} + +mkdir docs/.git +echo hi >docs/.git/ho +spurious-git-must-be-excluded + +echo hi >docs/.git +spurious-git-must-be-excluded + +mkdir not-really.git +echo fee >not-really.git/something +echo fi >not-really.gitfoo +echo fo >some.git +echo fum >some.gitfoo +git add . +git commit -m 'want these' + +t-dgit --quilt=smash -wgf build-source +t-dgit -wgf push + +t-ok -- 2.30.2