git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: perl t9700 failures?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 29, 2008, 20:18 UTC
Message-ID
<7v4p7c9erj.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.1.10.0806291241210.27776@hp.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 25 quoted lines
> 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 \
Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 9 in “perl t9700 failures?”
  1. Linus TorvaldsJun 29, 2008
  2. Junio C HamanoJun 29, 2008
  3. Linus TorvaldsJun 30, 2008
  4. Junio C HamanoJun 29, 2008
  5. Jakub NarebskiJun 29, 2008
  6. Lea WiemannJun 29, 2008
  7. Johannes SixtJun 30, 2008
  8. Skip Perl interface (Git.pm) tests if requirements not fullfilledJakub Narebski, Jun 29, 2008
  9. Johannes SchindelinJun 29, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.