git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv2 2/2] test-lib.sh: Allow running the test suite against installed git

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 16, 2009, 17:03 UTC
Message-ID
<1237222992-19421-3-git-send-email-git@drmicha.warpmail.net>
In-Reply-To
<7v3adfc0n4.fsf@gitster.siamese.dyndns.org>

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>
---
 t/test-lib.sh |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index b9da86e..c677904 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" &&
-- 
1.6.2.149.g6462
Previous: Michael J Gruber
Message 7 of 7 in “Allow running the test suite against installed git”
  1. 0/2 Allow running the test suite against installed gitMichael J Gruber, Mar 13, 2009
  2. 1/2 test-lib.sh: Test for presence of git-init in the right path.Michael J Gruber, Mar 13, 2009
  3. 2/2 test-lib.sh: Allow running the test suite against installed gitMichael J Gruber, Mar 13, 2009
  4. Junio C HamanoMar 14, 2009
  5. 0/2 Allow running the test suite against installed gitMichael J Gruber, Mar 16, 2009
  6. 1/2 test-lib.sh: Test for presence of git-init in the right path.Michael J Gruber, Mar 16, 2009
  7. 2/2 test-lib.sh: Allow running the test suite against installed gitMichael J Gruber, Mar 16, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.