File: win32_compile.t

package info (click to toggle)
libipc-run-perl 0.80-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 452 kB
  • ctags: 186
  • sloc: perl: 5,317; makefile: 44
file content (90 lines) | stat: -rwxr-xr-x 1,613 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/perl -w

=head1 NAME

win32_compile.t - See if IPC::Run::Win32Helper compiles, even on Unix

=cut

BEGIN { 
    if( $ENV{PERL_CORE} ) {
        chdir '../lib/IPC/Run' if -d '../lib/IPC/Run';
        unshift @INC, 'lib', '../..';
        $^X = '../../../t/' . $^X;
    }
}

use strict ;

use Test ;

BEGIN {
   unless ( eval "require 5.006" ) {
       ## NOTE: I'm working around this here because I don't want this
       ## test to fail on non-Win32 systems with older Perls.  Makefile.PL
       ## does the require 5.6.0 to protect folks on Windows.
       plan tests => 1;
       skip "perl5.00503's Socket.pm does not export IPPROTO_TCP", 1, 1;
       exit 0;
   }


   $INC{$_} = 1 for qw( Win32/Process.pm Win32API/File.pm ) ;

   package Win32API::File ;

   use vars qw( @ISA @EXPORT ) ;

   @ISA = qw( Exporter ) ;
   @EXPORT = qw(
      GetOsFHandle 
      OsFHandleOpen
      OsFHandleOpenFd
      FdGetOsFHandle
      SetHandleInformation
      SetFilePointer

      HANDLE_FLAG_INHERIT
      INVALID_HANDLE_VALUE

      createFile
      WriteFile
      ReadFile
      CloseHandle

      FILE_ATTRIBUTE_TEMPORARY
      FILE_FLAG_DELETE_ON_CLOSE
      FILE_FLAG_WRITE_THROUGH

      FILE_BEGIN
   ) ;

   eval "sub $_ { 1 }" for @EXPORT ;

   use Exporter ;

   package Win32::Process ;

   use vars qw( @ISA @EXPORT ) ;

   @ISA = qw( Exporter ) ;
   @EXPORT = qw(
      NORMAL_PRIORITY_CLASS
   ) ;

   eval "sub $_ {}" for @EXPORT ;

   use Exporter ;
}

sub Socket::IPPROTO_TCP() { undef }

package main ;

use IPC::Run::Win32Helper ;
use IPC::Run::Win32IO ;

plan tests => 1 ;

ok 1 ;