From: Ian Jackson Date: Sun, 17 May 2015 13:17:37 +0000 (+0100) Subject: Tests: Introduce t-set-using-tmp and use it in lib and adhoc X-Git-Tag: debian/0.30~146 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=d228327cc4aec6fef736c5d44abb0edf025a57f0 Tests: Introduce t-set-using-tmp and use it in lib and adhoc --- diff --git a/tests/adhoc b/tests/adhoc index a8a33624..b45251fa 100755 --- a/tests/adhoc +++ b/tests/adhoc @@ -44,6 +44,8 @@ case "$pwd" in ;; esac -export ADTTMP=$tmp HOME=$tmp DGIT_TEST_DUMMY_DIR=$tmp DGIT_TEST_TMP=$tmp +export ADTTMP=$tmp + +t-set-using-tmp exec "$@" diff --git a/tests/lib b/tests/lib index 3c31a29c..357bb861 100644 --- a/tests/lib +++ b/tests/lib @@ -24,14 +24,14 @@ fi cd $tmp tmp=`pwd` -export HOME=$tmp -export DGIT_TEST_DUMMY_DIR=$tmp + +t-set-using-tmp + ln -f $troot/ssh ssh mkdir -p $tmp/gnupg cp $troot/gnupg/* $tmp/gnupg chmod go-rw $tmp/gnupg/* -export GNUPGHOME=$tmp/gnupg mkdir -p $tmp/incoming cat <$tmp/dput.cf @@ -343,7 +343,6 @@ t-git-config () { t-drs () { export DGIT_TEST_TROOT=$troot - export DGIT_TEST_TMP=$tmp t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S " t-git-config dgit-distro.test-dummy.git-check true t-git-config dgit-distro.test-dummy.git-create true diff --git a/tests/lib-core b/tests/lib-core index 98ae85f5..f3881ca5 100644 --- a/tests/lib-core +++ b/tests/lib-core @@ -14,3 +14,10 @@ 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/gnupg +}