File: win32_compile.t

package info (click to toggle)
libipc-run-perl 0.92-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 736 kB
  • sloc: perl: 5,738; makefile: 5
file content (89 lines) | stat: -rw-r--r-- 1,574 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl

=pod

=head1 NAME

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

=cut

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

use Test::More;

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( skip_all => "perl5.00503's Socket.pm does not export IPPROTO_TCP" );
   }

   $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 );