tests: do not require Git to be built when testing an installed Git
[gitweb.git] / t / test-lib.sh
index 93883580a8b30482fdcccdddc724c92aeeef3f9d..3d3a65ed0ec5c1bfe11f3afed3c17c174c954c2e 100644 (file)
@@ -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