# Regression tester for SRC.
#
-# Needs to not be a subdirectory of here, or git gets confused
-SANDBOX=/tmp/src-sandbox
+# Set the umask for a bit of defensiveness
+umask 0077
+
+# Needs to not be a subdirectory of here, or git gets confused. Use
+# -u so that `src init` will work.
+SANDBOX=$(mktemp -u /tmp/.src_XXXXXXXX)
trap "rm -fr testfile* testrev* newname* $SANDBOX" 0 1 2 15
TESTOPTS="-T -S $SANDBOX $*"
-rm -fr $SANDBOX
-
# Catches dumb and obvious case of code having a Python syntax error
src $TESTOPTS init
check "init"
src $TESTOPTS ls | diff -u testfile16 -
check "ls"
+rm -fr $SANDBOX
+
# end