mirror of
https://github.com/git/git.git
synced 2026-01-18 14:44:28 +00:00
Merge branch 'test-git-installed'
This patch series contains a couple of fixes revolving around testing an installed Git, via GIT_TEST_INSTALLED=/path/to/git. The original motivation for these patches is that Git for Windows wants to provide a version where the Unix shell scripts are interpreted by BusyBox (to reduce the footprint on disk, mainly), and we want to verify that this actually works, and is not perchance missing any Unix shell tool that is present in the Git for Windows SDK but is missing from the installed set of files. While the BusyBox-based Git for Windows is not ready for prime time, this here patch series is, and might be useful for packagers who want to verify a similar scenario. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
1
Makefile
1
Makefile
@@ -2567,6 +2567,7 @@ GIT-BUILD-OPTIONS: FORCE
|
||||
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
|
||||
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
|
||||
@echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
|
||||
@echo X=\'$(X)\' >>$@+
|
||||
ifdef TEST_OUTPUT_DIRECTORY
|
||||
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
|
||||
endif
|
||||
|
||||
@@ -10,7 +10,12 @@ GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale"
|
||||
GIT_PO_PATH="$GIT_BUILD_DIR/po"
|
||||
export GIT_TEXTDOMAINDIR GIT_PO_PATH
|
||||
|
||||
. "$GIT_BUILD_DIR"/git-sh-i18n
|
||||
if test -n "$GIT_TEST_INSTALLED"
|
||||
then
|
||||
. "$(git --exec-path)"/git-sh-i18n
|
||||
else
|
||||
. "$GIT_BUILD_DIR"/git-sh-i18n
|
||||
fi
|
||||
|
||||
if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON
|
||||
then
|
||||
|
||||
@@ -927,7 +927,8 @@ test_create_repo () {
|
||||
mkdir -p "$repo"
|
||||
(
|
||||
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?"
|
||||
mv .git/hooks .git/hooks-disabled
|
||||
) || exit
|
||||
|
||||
@@ -49,18 +49,23 @@ export ASAN_OPTIONS
|
||||
: ${LSAN_OPTIONS=abort_on_error=1}
|
||||
export LSAN_OPTIONS
|
||||
|
||||
if test ! -f "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
|
||||
then
|
||||
echo >&2 'error: GIT-BUILD-OPTIONS missing (has Git been built?).'
|
||||
exit 1
|
||||
fi
|
||||
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
|
||||
export PERL_PATH SHELL_PATH
|
||||
|
||||
################################################################
|
||||
# It appears that people try to run tests without building...
|
||||
"$GIT_BUILD_DIR/git" >/dev/null
|
||||
test -n "$GIT_TEST_INSTALLED" || "$GIT_BUILD_DIR/git$X" >/dev/null ||
|
||||
if test $? != 1
|
||||
then
|
||||
echo >&2 'error: you do not seem to have built git yet.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
|
||||
export PERL_PATH SHELL_PATH
|
||||
|
||||
# if --tee was passed, write the output not only to the terminal, but
|
||||
# additionally to the file test-results/$BASENAME.out, too.
|
||||
case "$GIT_TEST_TEE_STARTED, $* " in
|
||||
@@ -1052,7 +1057,7 @@ elif test -n "$GIT_TEST_INSTALLED"
|
||||
then
|
||||
GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path) ||
|
||||
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}
|
||||
else # normal case, use ../bin-wrappers only unless $with_dashes:
|
||||
git_bin_dir="$GIT_BUILD_DIR/bin-wrappers"
|
||||
|
||||
Reference in New Issue
Block a user