Skip to content

Commit 2689f23

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 d56e7d3 commit 2689f23

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
@@ -2216,6 +2216,7 @@ GIT-BUILD-OPTIONS: FORCE
22162216
@echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
22172217
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
22182218
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
2219+
@echo X=\'$(X)\' >>$@+
22192220
ifdef TEST_OUTPUT_DIRECTORY
22202221
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
22212222
endif
@@ -2244,6 +2245,9 @@ ifdef GIT_PERF_MAKE_OPTS
22442245
endif
22452246
ifdef TEST_GIT_INDEX_VERSION
22462247
@echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
2248+
endif
2249+
ifdef MSVC_DEPS
2250+
@echo MSVC_DEPS=\''$(subst ','\'',$(subst ','\'',$(MSVC_DEPS)))'\' >>$@+
22472251
endif
22482252
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
22492253

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)