Skip to content

Commit 1a3f7eb

Browse files
committed
Fix CTest failures (#3977)
When building Git via Visual Studio and then running the tests via CTest (which is made very easy by Visual Studio), there are test failures. This PR intends to address those. This closes #3966
2 parents e0e7d91 + 4b8ccf1 commit 1a3f7eb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

t/test-lib.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ then
5151
TEST_OUTPUT_DIRECTORY=$TEST_DIRECTORY
5252
fi
5353
GIT_BUILD_DIR="${TEST_DIRECTORY%/t}"
54-
if test "$TEST_DIRECTORY" = "$GIT_BUILD_DIR"
54+
if test -f "$GIT_BUILD_DIR/GIT-BUILD-DIR"
55+
then
56+
GIT_BUILD_DIR="$(cat "$GIT_BUILD_DIR/GIT-BUILD-DIR")" || exit 1
57+
# On Windows, we must convert Windows paths lest they contain a colon
58+
case "$(uname -s)" in
59+
*MINGW*)
60+
GIT_BUILD_DIR="$(cygpath -au "$GIT_BUILD_DIR")"
61+
;;
62+
esac
63+
elif test "$TEST_DIRECTORY" = "$GIT_BUILD_DIR"
5564
then
5665
echo "PANIC: Running in a $TEST_DIRECTORY that doesn't end in '/t'?" >&2
5766
exit 1

0 commit comments

Comments
 (0)