ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/t/04_fork.t
Revision: 1.6
Committed: Wed Jun 29 10:36:04 2011 UTC (13 years ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.5: +7 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #!/usr/bin/perl
2    
3 root 1.6 BEGIN {
4     if ($^O ne "linux") {
5     print qq{1..0 # SKIP only linux supports pthreads and fork\n};
6     exit 0;
7     }
8     }
9    
10 root 1.1 use Test;
11     use IO::AIO;
12    
13     # this is a lame test, but....
14    
15 root 1.5 BEGIN { plan tests => 10 }
16 root 1.1
17     IO::AIO::min_parallel 2;
18    
19 root 1.5 IO::AIO::aio_nop sub {
20 root 1.3 print "ok 6\n";
21     };
22    
23 root 1.5 IO::AIO::aio_busy 0.2, sub {
24     print "ok 8\n";
25    
26     };
27    
28 root 1.1 print "ok 1\n";
29    
30     if (open FH, "-|") {
31     print while <FH>;
32     aio_stat "/", sub {
33 root 1.3 print "ok 7\n";
34 root 1.1 };
35 root 1.2 print "ok 5\n";
36 root 1.4 IO::AIO::poll while IO::AIO::nreqs;
37 root 1.5 print "ok 9\n";
38 root 1.1 } else {
39 root 1.2 print "ok 2\n";
40 root 1.1 aio_stat "/", sub {
41 root 1.2 print "ok 3\n";
42 root 1.1 };
43 root 1.4 IO::AIO::poll while IO::AIO::nreqs;
44 root 1.2 print "ok 4\n";
45 root 1.1 exit;
46     }
47    
48 root 1.5 print "ok 10\n";
49 root 1.1