chiark / gitweb /
Test suite: Introduce setup/gnupg
[dgit.git] / tests / lib-core
index 98ae85f5e8d1026ec5c6180fe47e8fabf8425588..056a1bc188c49f568df6046af46f94d2907c7f73 100644 (file)
@@ -14,3 +14,21 @@ t-set-intree () {
        export DGIT_TEST DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST
        export PERLLIB="$DGIT_TEST_INTREE${PERLLIB:+:}${PERLLIB}"
 }
+
+t-set-using-tmp () {
+       export HOME=$tmp
+       export DGIT_TEST_DUMMY_DIR=$tmp
+       export DGIT_TEST_TMP=$tmp
+       export GNUPGHOME=$tmp/nonexistent
+}
+
+t-filter-out-git-hyphen-dir () {
+       local pathent=$(type -p git-rev-parse ||:)
+       case "$pathent" in '') return ;; esac
+       pathent=${pathent%/*}
+       local path=":$PATH:"
+       path="${path//:$pathent:/}"
+       path="${path#:}"
+       path="${path%:}"
+       PATH="$path"
+}