Merge branch 'js/test-git-installed'
Update the "test installed Git" mode of our test suite to work better. * js/test-git-installed: tests: explicitly use `git.exe` on Windows tests: do not require Git to be built when testing an installed Git t/lib-gettext: test installed git-sh-i18n if GIT_TEST_INSTALLED is set tests: respect GIT_TEST_INSTALLED when initializing repositories tests: fix GIT_TEST_INSTALLED's PATH to include t/helper/
This commit is contained in:
1
Makefile
1
Makefile
@ -2592,6 +2592,7 @@ GIT-BUILD-OPTIONS: FORCE
|
|||||||
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
|
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
|
||||||
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
|
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
|
||||||
@echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
|
@echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
|
||||||
|
@echo X=\'$(X)\' >>$@+
|
||||||
ifdef TEST_OUTPUT_DIRECTORY
|
ifdef TEST_OUTPUT_DIRECTORY
|
||||||
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
|
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
|
||||||
endif
|
endif
|
||||||
|
@ -10,7 +10,12 @@ GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale"
|
|||||||
GIT_PO_PATH="$GIT_BUILD_DIR/po"
|
GIT_PO_PATH="$GIT_BUILD_DIR/po"
|
||||||
export GIT_TEXTDOMAINDIR GIT_PO_PATH
|
export GIT_TEXTDOMAINDIR GIT_PO_PATH
|
||||||
|
|
||||||
|
if test -n "$GIT_TEST_INSTALLED"
|
||||||
|
then
|
||||||
|
. "$(git --exec-path)"/git-sh-i18n
|
||||||
|
else
|
||||||
. "$GIT_BUILD_DIR"/git-sh-i18n
|
. "$GIT_BUILD_DIR"/git-sh-i18n
|
||||||
|
fi
|
||||||
|
|
||||||
if test_have_prereq GETTEXT && test_have_prereq C_LOCALE_OUTPUT
|
if test_have_prereq GETTEXT && test_have_prereq C_LOCALE_OUTPUT
|
||||||
then
|
then
|
||||||
|
@ -923,7 +923,8 @@ test_create_repo () {
|
|||||||
mkdir -p "$repo"
|
mkdir -p "$repo"
|
||||||
(
|
(
|
||||||
cd "$repo" || error "Cannot setup test environment"
|
cd "$repo" || error "Cannot setup test environment"
|
||||||
"$GIT_EXEC_PATH/git-init" "--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 ||
|
"${GIT_TEST_INSTALLED:-$GIT_EXEC_PATH}/git$X" init \
|
||||||
|
"--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 ||
|
||||||
error "cannot run git init -- have you built things yet?"
|
error "cannot run git init -- have you built things yet?"
|
||||||
mv .git/hooks .git/hooks-disabled
|
mv .git/hooks .git/hooks-disabled
|
||||||
) || exit
|
) || exit
|
||||||
|
@ -49,18 +49,28 @@ export ASAN_OPTIONS
|
|||||||
: ${LSAN_OPTIONS=abort_on_error=1}
|
: ${LSAN_OPTIONS=abort_on_error=1}
|
||||||
export LSAN_OPTIONS
|
export LSAN_OPTIONS
|
||||||
|
|
||||||
################################################################
|
if test ! -f "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
|
||||||
# It appears that people try to run tests without building...
|
|
||||||
"$GIT_BUILD_DIR/git" >/dev/null
|
|
||||||
if test $? != 1
|
|
||||||
then
|
then
|
||||||
echo >&2 'error: you do not seem to have built git yet.'
|
echo >&2 'error: GIT-BUILD-OPTIONS missing (has Git been built?).'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
|
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
|
||||||
export PERL_PATH SHELL_PATH
|
export PERL_PATH SHELL_PATH
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
# It appears that people try to run tests without building...
|
||||||
|
"${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git$X" >/dev/null
|
||||||
|
if test $? != 1
|
||||||
|
then
|
||||||
|
if test -n "$GIT_TEST_INSTALLED"
|
||||||
|
then
|
||||||
|
echo >&2 "error: there is no working Git at '$GIT_TEST_INSTALLED'"
|
||||||
|
else
|
||||||
|
echo >&2 'error: you do not seem to have built git yet.'
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# if --tee was passed, write the output not only to the terminal, but
|
# if --tee was passed, write the output not only to the terminal, but
|
||||||
# additionally to the file test-results/$BASENAME.out, too.
|
# additionally to the file test-results/$BASENAME.out, too.
|
||||||
case "$GIT_TEST_TEE_STARTED, $* " in
|
case "$GIT_TEST_TEE_STARTED, $* " in
|
||||||
@ -967,7 +977,7 @@ elif test -n "$GIT_TEST_INSTALLED"
|
|||||||
then
|
then
|
||||||
GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path) ||
|
GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path) ||
|
||||||
error "Cannot run git from $GIT_TEST_INSTALLED."
|
error "Cannot run git from $GIT_TEST_INSTALLED."
|
||||||
PATH=$GIT_TEST_INSTALLED:$GIT_BUILD_DIR:$PATH
|
PATH=$GIT_TEST_INSTALLED:$GIT_BUILD_DIR/t/helper:$PATH
|
||||||
GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}
|
GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}
|
||||||
else # normal case, use ../bin-wrappers only unless $with_dashes:
|
else # normal case, use ../bin-wrappers only unless $with_dashes:
|
||||||
git_bin_dir="$GIT_BUILD_DIR/bin-wrappers"
|
git_bin_dir="$GIT_BUILD_DIR/bin-wrappers"
|
||||||
|
Reference in New Issue
Block a user