diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-19 07:24:41 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-19 07:24:41 (GMT) |
commit | 2488849c7e76bed9069ba052a186b88214450cca (patch) | |
tree | 3c311a81ddd52a91e8ee03f4b9addbc4d696b470 /t/test-lib.sh | |
parent | 1c6e646235f5442bafcf303e3ed6a083efd3e0e0 (diff) | |
parent | 8abfdf44c882ad5d31bd8d0a0f1bfb67f8a9e39f (diff) | |
download | git-2488849c7e76bed9069ba052a186b88214450cca.zip git-2488849c7e76bed9069ba052a186b88214450cca.tar.gz git-2488849c7e76bed9069ba052a186b88214450cca.tar.bz2 |
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/
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index 219ca1d..6c6c0af 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -49,18 +49,28 @@ 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 +"${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.' + 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 -. "$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 @@ -967,7 +977,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" |