[PATCH] Skip Perl interface (Git.pm) tests if requirements not fullfilled

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

 



Signed-off-by: Jakub Narebski <jnareb@xxxxxxxxx>
---
Linus Torvalds wrote:

> Wouldn't it be a lot more polite to just not run the test when the 
> Test::More stuff doesn't exist? Rather than failing the testsuite? From a 
> quick "git grep", this test is the only one that uses Test::More...

Would this be enough?

 t/t9700-perl-git.sh |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh
index b2fb9ec..81ff84d 100755
--- a/t/t9700-perl-git.sh
+++ b/t/t9700-perl-git.sh
@@ -6,6 +6,18 @@
 test_description='perl interface (Git.pm)'
 . ./test-lib.sh
 
+perl -MTest::More -e '' >/dev/null 2>&1 || {
+	test_expect_success 'skipping Git.pm tests, Test::More module not found' :
+	test_done
+	exit
+}
+
+perl -e 'use 5.006002;' >/dev/null 2>&1 || {
+	test_expect_success 'skipping Git.pm tests, Perl version too old' :
+	test_done
+	exit
+}
+
 # set up test repository
 
 test_expect_success \
-- 
1.5.6

--
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]

  Powered by Linux