[PATCH 1/5] t/t5800: skip if python version is older than 2.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Brandon Casey <drafnel@xxxxxxxxx>

This test script depends on the git-remote-testgit python script.  This
python script makes use of the hashlib module which was released in python
version 2.5.  So, add a new pre-requisite named PYTHON_2_5_OR_NEWER to
test-lib.sh and check for it in t5800.

Signed-off-by: Brandon Casey <casey@xxxxxxxxxxxxxxx>
---
 t/t5800-remote-helpers.sh |    4 ++--
 t/test-lib.sh             |    9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/t/t5800-remote-helpers.sh b/t/t5800-remote-helpers.sh
index 75a0163..58f60ab 100755
--- a/t/t5800-remote-helpers.sh
+++ b/t/t5800-remote-helpers.sh
@@ -7,9 +7,9 @@ test_description='Test remote-helper import and export commands'
 
 . ./test-lib.sh
 
-if ! test_have_prereq PYTHON
+if ! test_have_prereq PYTHON_2_5_OR_NEWER
 then
-	say 'skipping git remote-testgit tests: requires Python support'
+	say 'skipping git remote-testgit tests: requires Python 2.5 or newer'
 	test_done
 fi
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 454880a..ce56e1c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -846,6 +846,15 @@ esac
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
+if test_have_prereq PYTHON && "$PYTHON_PATH" -c '
+import sys
+if sys.hexversion < 0x02050000:
+    sys.exit(1)
+'
+then
+	test_set_prereq PYTHON_2_5_OR_NEWER
+fi
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
-- 
1.6.6.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]