aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/test/test-setup.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/test/test-setup.sh b/tools/test/test-setup.sh
index fda8f00e2e..d8f2a47b67 100755
--- a/tools/test/test-setup.sh
+++ b/tools/test/test-setup.sh
@@ -222,14 +222,24 @@ fi
# path to workaround a bug with long executable paths when executing remote
# tests on Windows.
if [ ! -z "$TEST_SHORT_EXEC_PATH" ]; then
- # Use a short path like "t0" in the execution root. Use the smallest numeric
- # suffix that doesn't collide with an existing file or directory.
QUALIFIER=0
- while [[ -e "${EXEC_ROOT}/t${QUALIFIER}" ]]; do
+ BASE="${EXEC_ROOT}/t${QUALIFIER}"
+ while [[ -e "${BASE}" || -e "${BASE}.exe" || -e "${BASE}.zip" ]]; do
((QUALIFIER++))
+ BASE="${EXEC_ROOT}/t${QUALIFIER}"
done
- ln -s "${TEST_PATH}" "${EXEC_ROOT}/t${QUALIFIER}"
- TEST_PATH="${EXEC_ROOT}/t${QUALIFIER}"
+
+ # Note for the commands below: "ln -s" is equivalent to "cp" on Windows.
+
+ # Needs to be in the same directory for sh_test. Ignore the error when it
+ # doesn't exist.
+ ln -s "${TEST_PATH%.*}" "${BASE}" 2>/dev/null
+ # Needs to be in the same directory for py_test. Ignore the error when it
+ # doesn't exist.
+ ln -s "${TEST_PATH%.*}.zip" "${BASE}.zip" 2>/dev/null
+ # Needed for all tests.
+ ln -s "${TEST_PATH}" "${BASE}.exe"
+ TEST_PATH="${BASE}.exe"
fi
exitCode=0