Skip to content

Commit 10394da

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 3a5c470 commit 10394da

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
@@ -2211,6 +2211,7 @@ GIT-BUILD-OPTIONS: FORCE
22112211
@echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
22122212
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
22132213
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
2214+
@echo X=\'$(X)\' >>$@+
22142215
ifdef TEST_OUTPUT_DIRECTORY
22152216
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
22162217
endif
@@ -2239,6 +2240,9 @@ ifdef GIT_PERF_MAKE_OPTS
22392240
endif
22402241
ifdef TEST_GIT_INDEX_VERSION
22412242
@echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
2243+
endif
2244+
ifdef MSVC_DEPS
2245+
@echo MSVC_DEPS=\''$(subst ','\'',$(subst ','\'',$(MSVC_DEPS)))'\' >>$@+
22422246
endif
22432247
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
22442248

t/test-lib-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ test_create_repo () {
786786
mkdir -p "$repo"
787787
(
788788
cd "$repo" || error "Cannot setup test environment"
789-
"$GIT_EXEC_PATH/git-init" "--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 ||
789+
"$GIT_EXEC_PATH/git$X" init "--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 ||
790790
error "cannot run git init -- have you built things yet?"
791791
mv .git/hooks .git/hooks-disabled
792792
) || 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)