List Info

Thread: Skip win32core.t under Cygwin




Skip win32core.t under Cygwin
user name
2007-05-19 07:43:47
Jerry D. Hedden wrote:
> Under Cygwin, win32core.t is failing with the following
error:
>
>
ext/Win32CORE/t/win32core...................................
..#
> Failed test 'GetLastError() works on the first call'
> #   at ../ext/Win32CORE/t/win32core.t line 23.
> #          got: '0'
> #     expected: '42'
> # Looks like you failed 1 test of 4.
> FAILED at test 3

Jan Dubois wrote:
> It would be trivial to make $^E work on
"cygwin" the same
> way it works on "MSWin32".  I think this is
more useful
> than having $^E being an alias for $!.

Jerry D. Hedden wrote:
> The attached patch uses Jan's code and updates
perlvar.pod
> accordingly.

Steve Hay wrote:
> So does the test now pass for you with this patch?

Actually, that patch was no good.  It wouldn't compile.
As is, it produced:

mg.c: In function `Perl_magic_get':
mg.c:755: error: syntax error before "dwErr"
mg.c:756: error: `dwErr' undeclared (first use in this
function)
mg.c:756: error: (Each undeclared identifier is reported
only once
mg.c:756: error: for each function it appears in.)
mg.c:758: warning: implicit declaration of function
`PerlProc_GetOSError'
mg.c:762: warning: implicit declaration of function
`SetLastError'
make: *** [mg.o] Error 1

When I add the following to the top of mg.c:

#if defined(__CYGWIN__)
#  define WIN32_LEAN_AND_MEAN
#  include <windows.h>
#endif

It still fails to make:

In file included from perl.h:3263,
                 from mg.c:45:
perly.h:43: error: 'WORD' redeclared as different kind of
symbol
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api
/windef.h:241:
error: previous declaration of 'WORD' was here
mg.c: In function `Perl_magic_get':
mg.c:763: warning: implicit declaration of function
`PerlProc_GetOSError'
make: *** [mg.o] Error 1

The whole test should just be skipped under Cygwin.
The attached patch does this.

  
Re: Skip win32core.t under Cygwin
user name
2007-05-21 09:27:33
On 19/05/07, Jerry D. Hedden <jdheddencpan.org> wrote:
> The whole test should just be skipped under Cygwin.
> The attached patch does this.

Thanks, applied as #31249.

RE: Skip win32core.t under Cygwin
user name
2007-05-22 13:51:57
On Sat, 19 May 2007, Jerry D. Hedden wrote:
> Jan Dubois wrote:
> > It would be trivial to make $^E work on
"cygwin" the same
> > way it works on "MSWin32".  I think this
is more useful
> > than having $^E being an alias for $!.
> 
> Jerry D. Hedden wrote:
> > The attached patch uses Jan's code and updates
perlvar.pod
> > accordingly.
> 
> Steve Hay wrote:
> > So does the test now pass for you with this
patch?
> 
> Actually, that patch was no good.  It wouldn't
compile.
> As is, it produced:
> 
> mg.c: In function `Perl_magic_get':
> mg.c:755: error: syntax error before "dwErr"
> mg.c:756: error: `dwErr' undeclared (first use in this
function)
> mg.c:756: error: (Each undeclared identifier is
reported only once
> mg.c:756: error: for each function it appears in.)
> mg.c:758: warning: implicit declaration of function
`PerlProc_GetOSError'
> mg.c:762: warning: implicit declaration of function
`SetLastError'
> make: *** [mg.o] Error 1

[...]

> The whole test should just be skipped under Cygwin.

I'm fine with the test being skipped under Cygwin, as the
functionality
is being tested sufficiently by the MSWin32 builds.

A separate question is if Cygwin should have the $^E
functionality of
the MSWin32 builds. I still think it can be made to work,
even though
the PerlProc_GetOSError() call means we would have to copy
win32_str_os_error() from win32/win32.c to mg.c for the
Cygwin case
(or preferably to Cygwin/Cygwin.c).

On the other hand $^E is just syntactic sugar; you can
access all the
functionality via Win32::GetLastError(),
Win32::SetLastError() and
Win32::FormatMessage().

So if Yitzchak or Reini think Cygwin should support the $^E
interface to
[GS]etLastError(), then I'll try to come up with a patch
that will
actually compile.

Cheers,
-Jan


Re: Skip win32core.t under Cygwin
user name
2007-05-29 14:01:53
Jan Dubois schrieb:
> A separate question is if Cygwin should have the $^E
functionality of
> the MSWin32 builds. I still think it can be made to
work, even though
> the PerlProc_GetOSError() call means we would have to
copy
> win32_str_os_error() from win32/win32.c to mg.c for the
Cygwin case
> (or preferably to Cygwin/Cygwin.c).
> 
> On the other hand $^E is just syntactic sugar; you can
access all the
> functionality via Win32::GetLastError(),
Win32::SetLastError() and
> Win32::FormatMessage().
> 
> So if Yitzchak or Reini think Cygwin should support the
$^E interface to
> [GS]etLastError(), then I'll try to come up with a
patch that will
> actually compile.

I've never needed $^E, always did Win32::GetLastError().
But I have no strong opinion on that.
-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/
http://helsinki.at/  http://spacemovie.mur.at/

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )