Test-Stream

 view release on metacpan or  search on metacpan

t/modules/Hub.t  view on Meta::CPAN

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
        ok(!$?, "child exited with success");
        $hub->cull();
        $do_check->('Fork');
    }
    else {
        $do_send->();
        exit 0;
    }
}
 
if (CAN_THREAD && $] ge '5.010') {
    require threads;
    my $thr = threads->new(sub { $do_send->() });
    $thr->join;
    $hub->cull();
    $do_check->('Threads');
}
 
$do_send->();
$hub->cull();
$do_check->('no IPC');

t/modules/Sync.t  view on Meta::CPAN

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
    die "Failed to fork!" unless defined $pid;
    unless($pid) { exit 255 }
    my @warnings;
    {
        local $SIG{__WARN__} = sub { push @warnings => @_ };
        def is => ($sync->_ipc_wait, 255, "Process exited badly");
    }
    def like => (\@warnings, [qr/Process .* did not exit cleanly \(status: 255\)/], "Warn about exit");
}
 
if (CAN_THREAD && $] ge '5.010') {
    require threads;
    $reset->();
 
    threads->new(sub { 1 });
    def is => ($sync->_ipc_wait, 0, "No errors");
 
    if (threads->can('error')) {
        threads->new(sub {
            close(STDERR);
            close(STDOUT);



( run in 0.383 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )