about summary refs log tree commit homepage
path: root/t/test-lib.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 5551378..c8e069d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -15,8 +15,8 @@ die () {
         exit 1
 }
 
-TEST_RM_LIST=""
-trap 'rm -f $TEST_RM_LIST' 0
+_TEST_RM_LIST=""
+trap 'rm -f $_TEST_RM_LIST' 0
 PATH=$PWD/bin:$PATH
 export PATH
 
@@ -39,3 +39,14 @@ require_revactor () {
                 exit 0
         fi
 }
+
+# given a list of variable names, create temporary files and assign
+# the pathnames to those variables
+rtmpfiles () {
+        for id in "$@"
+        do
+                _tmp=$(mktemp -t rainbows.$$.$id.XXXXXXXX)
+                eval "$id=$_tmp"
+                _TEST_RM_LIST="$_TEST_RM_LIST $_tmp"
+        done
+}