chiark / gitweb /
Test suite: Provide new t-stunt facility
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 May 2015 12:27:45 +0000 (13:27 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 11:21:36 +0000 (12:21 +0100)
tests/lib

index 357bb86..1a9b042 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -323,6 +323,20 @@ t-822-field () {
        ' <$file
 }
 
+t-tstunt () {
+       local tstunt=$tmp/tstunt
+       mkdir -p $tstunt
+       case "$PATH" in
+       "$tstunt:"*)    ;;
+       *":$tstunt:"*)  ;;
+       *)              PATH="$tstunt:$PATH" ;;
+       esac
+       local f
+       for f in "$@"; do
+               ln -sf "$troot/tstunt/$f" "$tstunt"/.
+       done
+}
+
 t-ref-dsc-dgit () {
        local dsc=${p}_${v}.dsc
        local val=`t-822-field $tmp/incoming/$dsc Dgit`