summaryrefslogtreecommitdiff
path: root/tests/test-copy-file.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-copy-file.sh')
-rwxr-xr-xtests/test-copy-file.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test-copy-file.sh b/tests/test-copy-file.sh
index 98da280efb..cd2868d243 100755
--- a/tests/test-copy-file.sh
+++ b/tests/test-copy-file.sh
@@ -35,7 +35,12 @@ func_tmpdir ()
}
func_tmpdir
-builddir=`pwd`
+# builddir may already be set by the script that invokes this one.
+case "$builddir" in
+ '') builddir=`pwd` ;;
+ /* | ?:*) ;;
+ *) builddir=`pwd`/$builddir ;;
+esac
cd "$builddir" ||
{
echo "$0: cannot determine build directory (unreadable parent dir?)" >&2