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

Re: [PATCH] t9700-perl-git.sh: Fix a test failure on cygwin

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 27, 2008, 19:34 UTC
Message-ID
<7vd4jup800.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<48B5984B.4020901@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 24 quoted lines
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
> ---
>
> This patch fixes the t9700 test failure on cygwin. Don't ask me to
> explain why the original test.pl fails on cygwin, but passes on Linux!
>
> My perl version:
>
>     $ perl --version
>
>     This is perl, v5.8.7 built for cygwin-thread-multi-64int
>     (with 1 registered patch, see perl -V for more detail)
>
>     Copyright 1987-2005, Larry Wall
>
>     Perl may be copied only under the terms of either the Artistic License or the
>     GNU General Public License, which may be found in the Perl 5 source kit.
>
>     Complete documentation for Perl, including FAQ lists, should be found on
>     this system using `man perl' or `perldoc perl'.  If you have access to the
>     Internet, point your browser at http://www.perl.org/, the Perl Home Page.
>     $ 
>
> [My perl version on Linux is whatever comes with Ubuntu 7.04]
Curious.
What does this give you:
	$ cd t
        $ sh t9700-perl-git.sh -v

with the attached patch? Unfortunately this cannot be run with "-i -v" because 'test_external_without_stderr' uses test_external which in turn exits upon failure when -i is given, without letting the former to report what was given to the standard error stream (this is slightly offtopic but pertains to debuggability of tests, so Lea is Cc'ed).

For me, cwd() is the same as Cwd->cwd (this is from Perl 5.8.8); perhaps it behaves differently on Cygwin?

 t/t9700/test.pl |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git i/t/t9700/test.pl w/t/t9700/test.pl
index 851cea4..139711d 100755
--- i/t/t9700/test.pl
+++ w/t/t9700/test.pl
@@ -15,6 +15,12 @@ BEGIN { use_ok('Git') }
 
 # set up
 our $abs_repo_dir = Cwd->cwd;
+our $cwd = cwd();
+print STDERR "Cwd->cwd says '$abs_repo_dir'\n";
+print STDERR "cwd() says '$cwd'\n";
+
+exit(1);
+
 ok(our $r = Git->repository(Directory => "."), "open repository");
 
 # config
Previous: Ramsay JonesNext: Ramsay Jones
Message 2 of 3 in “t9700-perl-git.sh: Fix a test failure on cygwin”
  1. t9700-perl-git.sh: Fix a test failure on cygwinRamsay Jones, Aug 27, 2008
  2. Junio C HamanoAug 27, 2008
  3. Ramsay JonesAug 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.