[PATCH] Make sure we use compat/subprocess.py with Python 2.3 while running tests.

From: Junio C Hamano <junkio@cox.net>
Date: 2005-12-08 17:07:39
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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Dec 08 17:08:22 2005

This archive was generated by hypermail 2.1.8 : 2005-12-08 17:08:28 EST