From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18930 invoked by alias); 3 Dec 2007 10:02:10 -0000 Received: (qmail 18922 invoked by uid 22791); 3 Dec 2007 10:02:09 -0000 X-Spam-Check-By: sourceware.org Received: from ics.u-strasbg.fr (HELO ics.u-strasbg.fr) (130.79.112.250) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Dec 2007 10:02:00 +0000 Received: from ICSMULLER (laocoon.u-strasbg.fr [130.79.112.72]) by ics.u-strasbg.fr (Postfix) with ESMTP id 312C418701A for ; Mon, 3 Dec 2007 11:06:22 +0100 (CET) From: "Pierre Muller" To: Subject: [RFC] gdb/testsuite/gdb.base/fileio.exp patch for cygwin Date: Mon, 03 Dec 2007 10:02:00 -0000 Message-ID: <000101c83593$89c0fcd0$9d42f670$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00045.txt.bz2 I tried to expose some cygwin testsuite problems related to the fact that dejagnu does not seem to be able to fool the cygwin system, to get it to believe that the output is not redirected. http://sourceware.org/ml/gdb/2007-11/msg00273.html The main effect is that, Cygwin knowing that the output is redirected to a non-tty, it will start to use file buffering that will interact badly with the expectation of the gdb testsuite. A typical example is gdb.base/fileio.exp, because it shows both sides of what I am describing. By simply adding a setbuf (stdout, NULL); at the start of main, I reduce the number of failures from 38 to 3. The three remaining failures are the three tests for isatty function on stdin, stdout and stderr descriptors, which are the cause of the described problem. As said in the referenced email, I do not know if this is only because the cygwin port of dejagnu is old or if it is more general. Is a patch like this suitable for inclusion in gdb testsuite? If not, is there another way to try to improve the testsuite on cygwin? Pierre Muller ChangeLog entry: 2007-12-02 Pierre Muller * gdb.base/fileio.c (main): Disable file buffering for Cygwin. $ cvs diff -up gdb.base/fileio.c Index: gdb.base/fileio.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/fileio.c,v retrieving revision 1.10 diff -u -p -r1.10 fileio.c --- gdb.base/fileio.c 13 Jun 2006 08:55:22 -0000 1.10 +++ gdb.base/fileio.c 3 Dec 2007 09:58:17 -0000 @@ -1,5 +1,5 @@ -#include #include +#include #include #include #include @@ -542,6 +542,9 @@ strerrno (int err) int main () { +#ifdef __CYGWIN__ + setbuf (stdout, NULL); +#endif /* __CYGWIN__ */ /* Don't change the order of the calls. They partly depend on each other */ test_open (); test_write ();