diff options
author | Michael G. Schwern <schwern@pobox.com> | 2001-12-15 20:12:42 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-16 14:16:17 +0000 |
commit | de522f7a1bfa5ad2ba28f7336c1cdb042ae4dc8d (patch) | |
tree | 8f4ee88ff7f1e03cc114e0b1f93e500057c48556 /t | |
parent | 8881896e2b6c75868d2a80cf3faaa4960cc38832 (diff) | |
download | perl-de522f7a1bfa5ad2ba28f7336c1cdb042ae4dc8d.tar.gz |
Re: [PATCH t/test.pl] diagnostics to STDERR
Message-ID: <20011216061242.GB8900@blackrider>
p4raw-id: //depot/perl@13715
Diffstat (limited to 't')
-rw-r--r-- | t/test.pl | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -27,6 +27,13 @@ END { } } +# Use this instead of "print STDERR" when outputing failure diagnostic +# messages +sub _diag { + my $fh = $TODO ? *STDOUT : *STDERR; + print $fh @_; +} + sub skip_all { if (@_) { print STDOUT "1..0 - @_\n"; @@ -53,12 +60,12 @@ sub _ok { print STDOUT "$out\n"; unless ($pass) { - print STDERR "# Failed $where\n"; + _diag "# Failed $where\n"; } # Ensure that the message is properly escaped. - print STDERR map { /^#/ ? "$_\n" : "# $_\n" } - map { split /\n/ } @mess if @mess; + _diag map { /^#/ ? "$_\n" : "# $_\n" } + map { split /\n/ } @mess if @mess; $test++; @@ -206,12 +213,12 @@ sub eq_hash { $key = "" . $key; if (exists $orig->{$key}) { if ($orig->{$key} ne $value) { - print STDERR "# key ", _qq($key), " was ", _qq($orig->{$key}), - " now ", _qq($value), "\n"; + print STDOUT "# key ", _qq($key), " was ", _qq($orig->{$key}), + " now ", _qq($value), "\n"; $fail = 1; } } else { - print STDERR "# key ", _qq($key), " is ", _qq($value), + print STDOUT "# key ", _qq($key), " is ", _qq($value), ", not in original.\n"; $fail = 1; } @@ -220,7 +227,7 @@ sub eq_hash { # Force a hash recompute if this perl's internals can cache the hash key. $_ = "" . $_; next if (exists $suspect->{$_}); - print STDERR "# key ", _qq($_), " was ", _qq($orig->{$_}), " now missing.\n"; + print STDOUT "# key ", _qq($_), " was ", _qq($orig->{$_}), " now missing.\n"; $fail = 1; } !$fail; |