chiark / gitweb /
Tests: Introduce t-set-using-tmp and use it in lib and adhoc
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 May 2015 13:17:37 +0000 (14:17 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 10:54:14 +0000 (11:54 +0100)
tests/adhoc
tests/lib
tests/lib-core

index a8a33624f309e36f731da39b14afd8b73ae25261..b45251fa08685dd91c6bd6203a6c017e8bdd2e36 100755 (executable)
@@ -44,6 +44,8 @@ case "$pwd" in
        ;;
 esac
 
        ;;
 esac
 
-export ADTTMP=$tmp HOME=$tmp DGIT_TEST_DUMMY_DIR=$tmp DGIT_TEST_TMP=$tmp
+export ADTTMP=$tmp
+
+t-set-using-tmp
 
 exec "$@"
 
 exec "$@"
index 3c31a29cb11ff689128bb791d563002cf48f9bd3..357bb8613597808f9d955545a72d1e7448bed965 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -24,14 +24,14 @@ fi
 cd $tmp
 
 tmp=`pwd`
 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/*
 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 <<END >$tmp/dput.cf
 
 mkdir -p $tmp/incoming
 cat <<END >$tmp/dput.cf
@@ -343,7 +343,6 @@ t-git-config () {
 
 t-drs () {
        export DGIT_TEST_TROOT=$troot
 
 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
  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
index 98ae85f5e8d1026ec5c6180fe47e8fabf8425588..f3881ca561c008c407ca24755cdc9facce646039 100644 (file)
@@ -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}"
 }
        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
+}