git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Support TEST_GIT_PATH variable for the path for the git to test
@ 2008-02-25 23:21 Daniel Barkalow
  2008-02-26  0:00 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Barkalow @ 2008-02-25 23:21 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

This is useful if you want to see how some other version of git
handles the tests for some reason. (For example, see how a working
version manages to work while a broken one doesn't)

This version only sort of works, but it's enough to have been helpful in 
debugging builtin-clone, and most of what's left I don't really understand 
at all (the perl code, for example).

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
 t/test-lib.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 83889c4..5300549 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -281,7 +281,8 @@ test_create_repo () {
 	cd "$repo" || error "Cannot setup test environment"
 	"$GIT_EXEC_PATH/git" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||
 	error "cannot run git init -- have you built things yet?"
-	mv .git/hooks .git/hooks-disabled
+	[ ! -e .git/hooks ] || mv .git/hooks .git/hooks-disabled
+	[ -e .git/info ] || mkdir .git/info
 	cd "$owd"
 }
 
@@ -321,8 +322,8 @@ test_done () {
 
 # Test the binaries we have just built.  The tests are kept in
 # t/ subdirectory and are run in trash subdirectory.
-PATH=$(pwd)/..:$PATH
-GIT_EXEC_PATH=$(pwd)/..
+GIT_EXEC_PATH=${TEST_GIT_PATH:-$(pwd)/..}
+PATH=$GIT_EXEC_PATH:$(pwd)/..:$PATH
 GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
 unset GIT_CONFIG
 unset GIT_CONFIG_LOCAL
-- 
1.5.4.2.261.g851a5.dirty

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-02-26 21:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-25 23:21 [RFC] Support TEST_GIT_PATH variable for the path for the git to test Daniel Barkalow
2008-02-26  0:00 ` Junio C Hamano
2008-02-26 18:02   ` Daniel Barkalow
2008-02-26 18:46     ` Junio C Hamano
2008-02-26 19:16       ` Daniel Barkalow
2008-02-26 20:22         ` Junio C Hamano
2008-02-26 20:46           ` Daniel Barkalow
2008-02-26 21:01             ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).