[PATCH 1/5] t/t5800: skip if python version is older than 2.5
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Jun 2, 2010, 00:13 UTC
- Message-ID
- <Wt_M4qptcPdpY0Q3jqUbfCU_HpY9NEjqs9eujZFD2rsUj5HRo__oQm7EUCxzXu38mC0y-ilUA14@cipher.nrlssc.navy.mil>
- In-Reply-To
- <Wt_M4qptcPdpY0Q3jqUbfIk6yMCN9Ja5RCtRUsADK5OJGrz7R_Cq1oGpeQoN7A9uCvw38jm63Jo@cipher.nrlssc.navy.mil>
From: Brandon Casey <drafnel@gmail.com>
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@nrlssc.navy.mil> --- 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