Subject: bug#8571: closed (Re: bug#8571: misc/tty-eof SKIP reason)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 28 Apr 2011 09:17:02 +0000

Your bug report

#8571: misc/tty-eof SKIP reason

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
8571: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8571
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#8571: misc/tty-eof SKIP reason
From: Jim Meyering <[email-masked]>
To: Bruno Haible <[email-masked]>
Cc: [email-masked]
Date: Thu, 28 Apr 2011 11:16:42 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Bruno Haible wrote:
> building coreutils 8.12 on a Linux 2.6.25.20, glibc 2.8 machine, "make check"
> shows this line:
>
>   SKIP: misc/tty-eof
>
> But unlike for the other tests that are skipped, there is no explanation why
> it was skipped. I have to look into the misc/tty-eof.log file, there I find:
>   tty-eof: this script requires Perl's Expect package >=1.11
>
> Could the explanation be repeated in stdout or stderr, like for the other
> tests when they are skipped?

Sure.

>From 11a5a943f6c557f5cc057f073bed67829b0a05d0 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email-masked]>
Date: Thu, 28 Apr 2011 11:12:01 +0200
Subject: [PATCH] tests: tty-eof: when skipping, announce the reason to outer
 stderr,

where a person will be more likely to see it, not just to the log file.
* tests/misc/tty-eof (emit_skip_msg): New function.
Use it instead of "warn".
Suggested by Bruno Haible.
---
 tests/misc/tty-eof |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tests/misc/tty-eof b/tests/misc/tty-eof
index 14910dc..f5a6159 100755
--- a/tests/misc/tty-eof
+++ b/tests/misc/tty-eof
@@ -22,11 +22,26 @@
 use strict;
 (my $ME = $0) =~ s|.*/||;

+# Emit a diagnostic both to stderr and to $stderr_fileno_.
+# FIXME: don't hard-code that value (9), since it's already defined in init.cfg.
+sub emit_skip_msg ($)
+{
+  my ($msg) = @_;
+  my $stderr_fileno_ = 9;
+  warn $msg;
+  open FH, ">&$stderr_fileno_"
+    or warn "$ME: failed to dup stderr\n";
+  print FH $msg;
+  close FH
+    or warn "$ME: failed to close FD $stderr_fileno_\n";
+}
+
 # Some older versions of Expect.pm (e.g. 1.07) lack the log_user method,
 # so check for that, too.
 eval { require Expect; Expect->require_version('1.11') };
-$@ and (warn "$ME: this script requires Perl's Expect package >=1.11\n"),
-  exit 77;
+$@
+  and emit_skip_msg "$ME: this script requires Perl's Expect package >=1.11\n",
+    exit 77;

 {
   my $fail = 0;
--
1.7.5.421.g9d34e

Subject: misc/tty-eof SKIP reason
From: Bruno Haible <[email-masked]>
To: [email-masked]
Date: Thu, 28 Apr 2011 01:14:03 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

building coreutils 8.12 on a Linux 2.6.25.20, glibc 2.8 machine, "make check"
shows this line:

  SKIP: misc/tty-eof

But unlike for the other tests that are skipped, there is no explanation why
it was skipped. I have to look into the misc/tty-eof.log file, there I find:
  tty-eof: this script requires Perl's Expect package >=1.11

Could the explanation be repeated in stdout or stderr, like for the other
tests when they are skipped?

Bruno
-- 
In memoriam Marian Batko <http://pl.wikipedia.org/wiki/Marian_Batko>
<http://en.auschwitz.org.pl/m/index.php?Itemid=8&id=478&option=com_content&task=view>