From 3b0766cf7fd581dde3fb31b9264045fa201db77a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 9 Oct 2016 21:43:53 +0100 Subject: [PATCH] Test suite: gitconfig: New test Signed-off-by: Ian Jackson --- debian/tests/control | 2 +- tests/tests/gitconfig | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 tests/tests/gitconfig diff --git a/debian/tests/control b/debian/tests/control index 608cb697..f1df9a47 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -21,7 +21,7 @@ Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts Restrictions: x-dgit-git-only -Tests: build-modes build-modes-asplit build-modes-gbp-asplit clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast import-native import-nonnative inarchivecopy mismatches newtag-clone-nogit oldnewtagalt oldtag-clone-nogit overwrite-chkclog overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt +Tests: build-modes build-modes-asplit build-modes-gbp-asplit clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gitconfig import-native import-nonnative inarchivecopy mismatches newtag-clone-nogit oldnewtagalt oldtag-clone-nogit overwrite-chkclog overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts diff --git a/tests/tests/gitconfig b/tests/tests/gitconfig new file mode 100755 index 00000000..263d7332 --- /dev/null +++ b/tests/tests/gitconfig @@ -0,0 +1,38 @@ +#!/bin/bash +set -e +. tests/lib + +t-tstunt-parsechangelog + +t-prep-newpackage example 1.0 + +cd $p + +t-dgit clean | tee ../t.output +grep 'EXAMPLE RULES TARGET clean' ../t.output + +t-git-config dgit.default.clean-mode git + +t-dgit clean | tee ../t.output + +set +e +grep 'EXAMPLE RULES TARGET clean' ../t.output +rc=$? +set -e +test $rc = 1 + +git config dgit.default.clean-mode dpkg-source-d + +t-dgit clean | tee ../t.output +grep 'EXAMPLE RULES TARGET clean' ../t.output + +t-git-config dgit.default.opts-dpkg-buildpackage --dgit-fail-global +git config --add dgit.default.opts-dpkg-buildpackage --dgit-fail-foo +git config --add dgit.default.opts-dpkg-buildpackage --dgit-fail-bar + +t-expect-fail '--dgit-fail-global --dgit-fail-foo --dgit-fail-bar' \ +t-dgit clean + +t-dgit -cdgit.default.clean-mode=none clean + +echo ok. -- 2.30.2