summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-11-14 16:32:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-16 05:18:00 (GMT)
commited306e4e0fbb621001f008e6d50718898be4fc09 (patch)
tree754d45898d45e7ca631d22cb4f0d84311bc0b9e0 /t/test-lib.sh
parent875bf17e39f1651550d6c620c7e74d6e1d967641 (diff)
downloadgit-ed306e4e0fbb621001f008e6d50718898be4fc09.zip
git-ed306e4e0fbb621001f008e6d50718898be4fc09.tar.gz
git-ed306e4e0fbb621001f008e6d50718898be4fc09.tar.bz2
tests: do not require Git to be built when testing an installed Git
We really only need the test helpers to be built in the worktree in that case, but that is not what we test for. On the other hand it is a perfect opportunity to verify that `GIT_TEST_INSTALLED` points to a working Git. So let's test the appropriate Git executable. While at it, also adjust the error message in the `GIT_TEST_INSTALLED` case. This patch is best viewed with `-w --patience`. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 9388358..3d3a65e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -51,10 +51,15 @@ export LSAN_OPTIONS
################################################################
# It appears that people try to run tests without building...
-"$GIT_BUILD_DIR/git" >/dev/null
+"${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git" >/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