git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t9700-perl-git.sh: Fix a test failure on Cygwin
@ 2009-11-19 18:41 Ramsay Jones
  2009-12-30 13:40 ` Nanako Shiraishi
  0 siblings, 1 reply; 8+ messages in thread
From: Ramsay Jones @ 2009-11-19 18:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing-list


The t/t9700/test.pl script uses method invocation syntax when
using the Cwd module to determine the current working directory.
This fails on cygwin, since cygwin perl specifically checks for
any arguments to the cwd() function and croak()'s with the message
"Usage: Cwd::cwd()". (In perl v5.8.8 distribution, see the file
perl-5.8.8/cygwin/cygwin.c lines 139-157)

In order to avoid the problem, we replace the method invocation
syntax with a simple function call.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 t/t9700/test.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t9700/test.pl b/t/t9700/test.pl
index 6c70aec..666722d 100755
--- a/t/t9700/test.pl
+++ b/t/t9700/test.pl
@@ -13,7 +13,7 @@ use File::Basename;
 BEGIN { use_ok('Git') }
 
 # set up
-our $abs_repo_dir = Cwd->cwd;
+our $abs_repo_dir = cwd();
 ok(our $r = Git->repository(Directory => "."), "open repository");
 
 # config
-- 
1.6.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] t9700-perl-git.sh: Fix a test failure on cygwin
@ 2008-08-27 18:09 Ramsay Jones
  2008-08-27 19:34 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Ramsay Jones @ 2008-08-27 18:09 UTC (permalink / raw)
  To: GIT Mailing-list; +Cc: Junio C Hamano


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]

ATB,

Ramsay Jones

 t/t9700/test.pl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t9700/test.pl b/t/t9700/test.pl
index 4d23125..6d59356 100755
--- a/t/t9700/test.pl
+++ b/t/t9700/test.pl
@@ -15,9 +15,9 @@ BEGIN { use_ok('Git') }
 
 # set up
 our $repo_dir = "trash directory";
-our $abs_repo_dir = Cwd->cwd;
+our $abs_repo_dir = cwd();
 die "this must be run by calling the t/t97* shell script(s)\n"
-    if basename(Cwd->cwd) ne $repo_dir;
+    if basename($abs_repo_dir) ne $repo_dir;
 ok(our $r = Git->repository(Directory => "."), "open repository");
 
 # config
-- 
1.6.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-01-01  0:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-19 18:41 [PATCH] t9700-perl-git.sh: Fix a test failure on Cygwin Ramsay Jones
2009-12-30 13:40 ` Nanako Shiraishi
2009-12-31  6:49   ` Junio C Hamano
2010-01-01  0:05     ` Nanako Shiraishi
2010-01-01  0:07       ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2008-08-27 18:09 [PATCH] t9700-perl-git.sh: Fix a test failure on cygwin Ramsay Jones
2008-08-27 19:34 ` Junio C Hamano
2008-08-29 20:56   ` Ramsay Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).