summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2009-03-16 17:03:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-16 19:19:10 (GMT)
commit6720721e152aee230387546efac865319f025597 (patch)
tree1a51f55477b359b31d0131d65d5357befdc7fced
parent7ee3760e2c8f181f22d4b80afc03309e4f764385 (diff)
downloadgit-6720721e152aee230387546efac865319f025597.zip
git-6720721e152aee230387546efac865319f025597.tar.gz
git-6720721e152aee230387546efac865319f025597.tar.bz2
test-lib.sh: Allow running the test suite against installed git
Introduce variables GIT_TEST_INSTALLED and GIT_TEST_EXEC_PATH such that the test suite can be run against a git which is installed at GIT_TEST_INSTALLED with subcommands at GIT_TEST_EXEC_PATH. GIT_TEST_INSTALLED defaults to the git.git checkout, GIT_TEST_EXEC_PATH defaults to the output of '$GIT_TEST_INSTALLED/git --exec-path'. Run the suite e.g. as GIT_TEST_INSTALLED=/some/path make test but note that this requires and uses parts of a compiled git in the git.git checkout: test helpers, templates and perl libraries are taken from there. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/test-lib.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index dace24c..a70b633 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -514,8 +514,16 @@ test_done () {
TEST_DIRECTORY=$(pwd)
if test -z "$valgrind"
then
- PATH=$TEST_DIRECTORY/..:$PATH
- GIT_EXEC_PATH=$TEST_DIRECTORY/..
+ if test -z "$GIT_TEST_INSTALLED"
+ then
+ PATH=$TEST_DIRECTORY/..:$PATH
+ GIT_EXEC_PATH=$TEST_DIRECTORY/..
+ else
+ GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path) ||
+ error "Cannot run git from $GIT_TEST_INSTALLED."
+ PATH=$GIT_TEST_INSTALLED:$TEST_DIRECTORY/..:$PATH
+ GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}
+ fi
else
make_symlink () {
test -h "$2" &&