git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Mark Allen <mrallen1@yahoo.com>
Cc: git@vger.kernel.org
Subject: [PATCH] Make sure we use compat/subprocess.py with Python 2.3 while running tests.
Date: Wed, 07 Dec 2005 22:07:39 -0800	[thread overview]
Message-ID: <7vr78oktp0.fsf_-_@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vslt4rb4v.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Wed, 07 Dec 2005 10:54:24 -0800")

Otherwise the test will not succeed without installing.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

  Junio C Hamano <junkio@cox.net> writes:

  > Mark Allen <mrallen1@yahoo.com> writes:
  >
  >> So, basically the problem is that the subprocess.py module is
  >> in the compat directory, and by default (I think)..
  >
  > Ah, you are right.
  >
  > Just like we fix PATH and GIT_EXEC_PATH during the test
  > execution, we need to do something with PYTHONPATH environment
  > variable (this one is _without_ underscore), I think.

  This seems to fix it for me.

 t/test-lib.sh |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

49ccb0877f64308662669a09db7b221419c13d0a
diff --git a/t/test-lib.sh b/t/test-lib.sh
index f2eccd7..0539dac 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -172,7 +172,18 @@ test_done () {
 # t/ subdirectory and are run in trash subdirectory.
 PATH=$(pwd)/..:$PATH
 GIT_EXEC_PATH=$(pwd)/..
-export GIT_EXEC_PATH
+export PATH GIT_EXEC_PATH
+
+# Similarly use ../compat/subprocess.py if our python does not
+# have subprocess.py on its own.
+PYTHON=`sed -e '1{
+	s/^#!//
+	q
+}' ../git-merge-recursive` &&
+"$PYTHON" -c 'import subprocess' 2>/dev/null || {
+	PYTHONPATH=$(pwd)/../compat
+	export PYTHONPATH
+}
 
 # Test repository
 test=trash
-- 
0.99.9.GIT

  reply	other threads:[~2005-12-08  6:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-07 16:49 Failure in t6021 on Red Hat Enterprise Linux 4 Mark Allen
2005-12-07 17:38 ` Junio C Hamano
2005-12-07 18:12   ` Mark Allen
2005-12-07 18:54     ` Junio C Hamano
2005-12-08  6:07       ` Junio C Hamano [this message]
2005-12-08 17:04         ` [PATCH] Make sure we use compat/subprocess.py with Python 2.3 while running tests Mark Allen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vr78oktp0.fsf_-_@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=mrallen1@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).