Skip to content

Commit

Permalink
test-lib.sh: Allow running the test suite against installed git
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Mar 16, 2009
1 parent 7ee3760 commit 6720721
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" &&
Expand Down

0 comments on commit 6720721

Please sign in to comment.