#!/usr/bin/perl

use lib '.'; use lib 't';
use SATest; sa_t_init("spamc_c_stdout_closed");
use Test; BEGIN { plan tests => 2 };

# ---------------------------------------------------------------------------

%patterns = (
);

start_spamd("-L");

sub myrun {
  open (OLDOUT, ">&STDOUT");
  close STDOUT;
  my $ret = spamcrun (@_);
  open (STDOUT, ">&OLDOUT");
  $ret;
}

ok (!myrun ("-c < data/spam/001", \&patterns_run_cb));
ok (myrun ("-c < data/nice/001", \&patterns_run_cb));
stop_spamd();



#!/usr/bin/perl

use lib '.'; use lib 't';
use SATest; sa_t_init("spamc_c_stdout_closed");
use Test; BEGIN { plan tests => 2 };

# ---------------------------------------------------------------------------

%patterns = (
);

start_spamd("-L");

my @warnings;
sub myrun {
  open (OLDOUT, ">&STDOUT");
  close STDOUT;

  # redirect warnings to (the real) STDOUT
  local($SIG{'__WARN__'}) = sub { print OLDOUT @_ };

  my $ret = spamcrun (@_);

  open (STDOUT, ">&OLDOUT");

  return $ret;
}

ok (!myrun ("-c < data/spam/001", \&patterns_run_cb));
ok (myrun ("-c < data/nice/001", \&patterns_run_cb));
stop_spamd();



Make the spamc-c-with-closed-stdout-test more silent under Perl 5.005.
Make the spamc-c-with-closed-stdout-test more silent under Perl 5.005.


git-svn-id: d99324e817494df82bb0080d8e7ab74680731a10@5620 13f79535-47bb-0310-9956-ffa450edef68
