summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-05-29 10:05:38 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-05-30 10:13:47 +0100
commitc89c565299851461b414629cdcc9a717c2d391bb (patch)
tree64c709de9ba5d0f182602db5761503cf5c7b4765 /tests
parent77e3237fca64dcbf4998cbcda1ef496a16c87984 (diff)
downloadmorph-c89c565299851461b414629cdcc9a717c2d391bb.tar.gz
Add test for using --tempdir
Diffstat (limited to 'tests')
-rwxr-xr-xtests/uses-tempdir.script26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/uses-tempdir.script b/tests/uses-tempdir.script
new file mode 100755
index 00000000..d00293a2
--- /dev/null
+++ b/tests/uses-tempdir.script
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Test that temporary directories are created in the dir specified
+# by --tempdir rather than specified in the environment by TMPDIR.
+#
+# Copyright (C) 2011, 2012 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -eu
+export TMPDIR
+TMPDIR="$DATADIR"/unwritable-tmp
+install -m 000 -d "$TMPDIR"
+mkdir "$DATADIR"/tmp
+"$SRCDIR/scripts/test-morph" build --tempdir "$DATADIR"/tmp test:morphs-repo master hello-stratum.morph