Skip to content

Commit 2c37cec

Browse files
committed
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 2ef0870 commit 2c37cec

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,7 @@ GIT-BUILD-OPTIONS: FORCE
22302230
@echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
22312231
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
22322232
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
2233+
@echo X=\'$(X)\' >>$@+
22332234
ifdef TEST_OUTPUT_DIRECTORY
22342235
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
22352236
endif
@@ -2258,6 +2259,9 @@ ifdef GIT_PERF_MAKE_OPTS
22582259
endif
22592260
ifdef TEST_GIT_INDEX_VERSION
22602261
@echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
2262+
endif
2263+
ifdef MSVC_DEPS
2264+
@echo MSVC_DEPS=\''$(subst ','\'',$(subst ','\'',$(MSVC_DEPS)))'\' >>$@+
22612265
endif
22622266
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
22632267

t/test-lib-functions.sh

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

t/test-lib.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,27 @@ then
3636
fi
3737
GIT_BUILD_DIR="$TEST_DIRECTORY"/..
3838

39+
if test ! -f "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
40+
then
41+
echo >&2 'error: GIT-BUILD-OPTIONS missing (has Git been built?).'
42+
exit 1
43+
fi
44+
45+
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
46+
export PERL_PATH SHELL_PATH
47+
48+
test -z "$MSVC_DEPS" ||
49+
PATH="$GIT_BUILD_DIR/$MSVC_DEPS/bin:$PATH"
50+
3951
################################################################
4052
# It appears that people try to run tests without building...
41-
"$GIT_BUILD_DIR/git" >/dev/null
53+
"$GIT_BUILD_DIR/git$X" >/dev/null
4254
if test $? != 1
4355
then
4456
echo >&2 'error: you do not seem to have built git yet.'
4557
exit 1
4658
fi
4759

48-
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
49-
export PERL_PATH SHELL_PATH
50-
5160
# if --tee was passed, write the output not only to the terminal, but
5261
# additionally to the file test-results/$BASENAME.out, too.
5362
case "$GIT_TEST_TEE_STARTED, $* " in

0 commit comments

Comments
 (0)