From 7ee3760e2c8f181f22d4b80afc03309e4f764385 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 16 Mar 2009 18:03:11 +0100 Subject: [PATCH 1/2] test-lib.sh: Test for presence of git-init in the right path. It just happens so that when GIT_EXEC_PATH points to a compiled checkout of git.git it contains "git". Since this is not true in general make test-lib check for "git-init" which is always in GIT_EXEC_PATH. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index 1e01a912a..dace24c54 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -454,7 +454,7 @@ test_create_repo () { repo="$1" mkdir -p "$repo" cd "$repo" || error "Cannot setup test environment" - "$GIT_EXEC_PATH/git" init "--template=$owd/../templates/blt/" >&3 2>&4 || + "$GIT_EXEC_PATH/git-init" "--template=$owd/../templates/blt/" >&3 2>&4 || error "cannot run git init -- have you built things yet?" mv .git/hooks .git/hooks-disabled cd "$owd" From 6720721e152aee230387546efac865319f025597 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 16 Mar 2009 18:03:12 +0100 Subject: [PATCH 2/2] 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 Signed-off-by: Junio C Hamano --- t/test-lib.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index dace24c54..a70b633dd 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" &&