my $TAP_STREAM = *STDOUT;
my $DIAG_STREAM = *STDERR;
+for ($TAP_STREAM, $DIAG_STREAM) {
+ my $fh = select $_;
+ $|++;
+ select $fh;
+}
+
my ($plan, $test, $failed, $no_diag, $done_testing);
sub NO_PLAN () { -1 }
BEGIN {
if (THREADSAFE) {
- threads::shared::share($_) for $plan, $test, $failed, $no_diag;
+ threads::shared::share($_) for $plan, $test, $failed, $no_diag, $done_testing;
}
lock $plan if THREADSAFE;
croak("plan() doesn't understand @args");
}
- {
- my $fh = select $TAP_STREAM;
- $|++;
- select $fh;
- }
-
if (defined $plan_str) {
local $\;
print $TAP_STREAM "$plan_str\n";
push @imports, @{ $_[$i+1] };
$splice = 2;
} elsif ($item eq 'no_diag') {
+ lock $plan if THREADSAFE;
$no_diag = 1;
$splice = 1;
}