summaryrefslogtreecommitdiff
path: root/tests/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-09 21:43:53 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-10 01:04:29 +0100
commit3b0766cf7fd581dde3fb31b9264045fa201db77a (patch)
tree79a74dad2b4e8eede910d8cfe88018b3d7fceefe /tests/tests
parentb2bdd40bf5ae556a916474702768d26c380be7d1 (diff)
Test suite: gitconfig: New test
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests/tests')
-rwxr-xr-xtests/tests/gitconfig38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/tests/gitconfig b/tests/tests/gitconfig
new file mode 100755
index 0000000..263d733
--- /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.