aboutsummaryrefslogtreecommitdiff
path: root/test.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-10-10 22:24:20 +0200
committerJakob Unterwurzacher2018-10-10 22:24:20 +0200
commit5a1ebdb4f7449759656a1344d3c63ba3798e2782 (patch)
treea551606ba0c53521fee1b93c71ee268682493644 /test.bash
parente4f1a32a9a109805107fc0655006f2eedf75c52c (diff)
tests: respect TMPDIR if set
Setting TMPDIR now allows to run the tests against a directory of your choice, making it easier to test different filesystems.
Diffstat (limited to 'test.bash')
-rwxr-xr-xtest.bash8
1 files changed, 7 insertions, 1 deletions
diff --git a/test.bash b/test.bash
index d306b7e..628feff 100755
--- a/test.bash
+++ b/test.bash
@@ -1,10 +1,16 @@
#!/bin/bash
+if [[ -z $TMPDIR ]]; then
+ TMPDIR=/tmp
+else
+ echo "Using TMPDIR=$TMPDIR"
+fi
+
set -eu
cd "$(dirname "$0")"
MYNAME=$(basename "$0")
-TESTDIR=/tmp/gocryptfs-test-parent
+TESTDIR=$TMPDIR/gocryptfs-test-parent
mkdir -p $TESTDIR
LOCKFILE=$TESTDIR/$MYNAME.lock