File: 04_fork.t

package info (click to toggle)
libio-aio-perl 4.81-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 988 kB
  • sloc: ansic: 5,008; perl: 603; makefile: 11; sh: 2
file content (50 lines) | stat: -rw-r--r-- 712 bytes parent folder | download | duplicates (7)
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
#!/usr/bin/perl

BEGIN {
   if ($^O eq "MSWin32") {
      print qq{1..0 # SKIP perl broken beyond repair\n};
      exit 0;
   }
}

use Test;
use IO::AIO;

# this is a lame test, but....

BEGIN { plan tests => 10 }

IO::AIO::min_parallel 2;

IO::AIO::aio_nop sub {
   print "ok 6\n";
};

IO::AIO::aio_busy 1, sub {
   print "ok 8\n";

};

print "ok 1\n";

if (open FH, "-|") {
   print while <FH>;
   aio_stat "/", sub {
      print "ok 7\n";
   };
   print "ok 5\n";
   IO::AIO::poll while IO::AIO::nreqs;
   print "ok 9\n";
} else {
   IO::AIO::reinit;
   print "ok 2\n";
   aio_stat "/", sub {
      print "ok 3\n";
   };
   IO::AIO::poll while IO::AIO::nreqs;
   print "ok 4\n";
   exit;
}

print "ok 10\n";