Skip to content

Commit e2a8ff3

Browse files
dschoGit for Windows Build Agent
authored andcommitted
msvc: fix make test without having to play PATH games
When building with Microsoft Visual C, we use NuGet to acquire the dependencies (such as OpenSSL, cURL, etc). We even unpack those dependencies. This patch teaches the test suite to add the directory with the unpacked .dll files to the PATH before running the tests. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 65f3b0c commit e2a8ff3

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,6 +2374,7 @@ GIT-BUILD-OPTIONS: FORCE
23742374
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
23752375
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
23762376
@echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
2377+
@echo X=\'$(X)\' >>$@+
23772378
ifdef TEST_OUTPUT_DIRECTORY
23782379
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
23792380
endif
@@ -2408,6 +2409,9 @@ ifdef GIT_INTEROP_MAKE_OPTS
24082409
endif
24092410
ifdef TEST_GIT_INDEX_VERSION
24102411
@echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
2412+
endif
2413+
ifdef MSVC_DEPS
2414+
@echo MSVC_DEPS=\''$(subst ','\'',$(subst ','\'',$(MSVC_DEPS)))'\' >>$@+
24112415
endif
24122416
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
24132417

t/test-lib-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ test_create_repo () {
797797
mkdir -p "$repo"
798798
(
799799
cd "$repo" || error "Cannot setup test environment"
800-
"$GIT_EXEC_PATH/git-init" "--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 ||
800+
"$GIT_EXEC_PATH/git$X" init "--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 ||
801801
error "cannot run git init -- have you built things yet?"
802802
mv .git/hooks .git/hooks-disabled
803803
) || exit

t/test-lib.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,26 @@ export ASAN_OPTIONS
4949
: ${LSAN_OPTIONS=abort_on_error=1}
5050
export LSAN_OPTIONS
5151

52+
if test ! -f "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
53+
then
54+
echo >&2 'error: GIT-BUILD-OPTIONS missing (has Git been built?).'
55+
exit 1
56+
fi
57+
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
58+
export PERL_PATH SHELL_PATH
59+
60+
test -z "$MSVC_DEPS" ||
61+
PATH="$GIT_BUILD_DIR/$MSVC_DEPS/bin:$PATH"
62+
5263
################################################################
5364
# It appears that people try to run tests without building...
54-
"$GIT_BUILD_DIR/git" >/dev/null
65+
"$GIT_BUILD_DIR/git$X" >/dev/null
5566
if test $? != 1
5667
then
5768
echo >&2 'error: you do not seem to have built git yet.'
5869
exit 1
5970
fi
6071

61-
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
62-
export PERL_PATH SHELL_PATH
63-
6472
# if --tee was passed, write the output not only to the terminal, but
6573
# additionally to the file test-results/$BASENAME.out, too.
6674
case "$GIT_TEST_TEE_STARTED, $* " in

0 commit comments

Comments
 (0)