Re: perl t9700 failures?

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

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> Am I the only one who gets this error:
>
> 	*** t9700-perl-git.sh ***
> 	*   ok 1: set up test repository
> 	*  run 2: Perl API (perl ../t9700/test.pl)
> 	* FAIL 2: Perl API
> 	        perl ../t9700/test.pl
> 	* FAIL 3: no stderr: Perl API
> 	        perl ../t9700/test.pl
> 	* failed 2 among 3 test(s)
>
> which I have no idea about, since to me perl is a black box, and doing  
> run of the tests with '-i -v' doesn't actually tell any more about which 
> part of the perl script is failing, or why.. Trying to run the perl thing 
> by hand, though, gives me this:
>
> 	Can't locate Test/More.pm in @INC (@INC contains: ...)
>
> which is presumably the problem. It looks like it is assuming I have the 
> Test::More perl libs, which I presumably don't have, don't have any clue 
> where they are, nor really any interest in installing.
>
> 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..

Hmm.  I was told that Test::More was part of the std Perl distribution
(and my quick check showed I happened to have that installed on my boxes
even though I do not use it myself and assumed it was there because the
claim is true).  Another test that does rely on more obscure Perl library
does refrain from running when it is not available, though...

Perlhaps something liek this should be sufficient.

diff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh
index b2fb9ec..9b57ad1 100755
--- a/t/t9700-perl-git.sh
+++ b/t/t9700-perl-git.sh
@@ -6,6 +6,11 @@
 test_description='perl interface (Git.pm)'
 . ./test-lib.sh
 
+perl -MTest::More -e 0 2>/dev/null || {
+	say_color skip >&3 "Perl Test::More not available, skipping test"
+	test_done
+}
+
 # set up test repository
 
 test_expect_success \

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