Skip to content

Commit

Permalink
Fix CTest failures (#3977)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dscho committed Nov 3, 2022
2 parents f69bd1d + 73ca49a commit 83cba02
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,16 @@ then
TEST_OUTPUT_DIRECTORY=$TEST_DIRECTORY
fi
GIT_BUILD_DIR="${TEST_DIRECTORY%/t}"
if test "$TEST_DIRECTORY" = "$GIT_BUILD_DIR"
if test -f "$GIT_BUILD_DIR/GIT-BUILD-DIR"
then
GIT_BUILD_DIR="$(cat "$GIT_BUILD_DIR/GIT-BUILD-DIR")" || exit 1
# On Windows, we must convert Windows paths lest they contain a colon
case "$(uname -s)" in
*MINGW*)
GIT_BUILD_DIR="$(cygpath -au "$GIT_BUILD_DIR")"
;;
esac
elif test "$TEST_DIRECTORY" = "$GIT_BUILD_DIR"
then
echo "PANIC: Running in a $TEST_DIRECTORY that doesn't end in '/t'?" >&2
exit 1
Expand Down

0 comments on commit 83cba02

Please sign in to comment.