From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFC] gdb/testsuite/gdb.base/fileio.exp patch for cygwin
Date: Mon, 03 Dec 2007 10:02:00 -0000 [thread overview]
Message-ID: <000101c83593$89c0fcd0$9d42f670$@u-strasbg.fr> (raw)
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 <muller@ics.u-strasbg.fr>
* 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 <stdio.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <sys/errno.h>
#include <sys/types.h>
@@ -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 ();
next reply other threads:[~2007-12-03 10:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-03 10:02 Pierre Muller [this message]
2007-12-04 23:50 ` Pedro Alves
2007-12-05 9:22 ` Pierre Muller
2007-12-05 22:56 ` Pedro Alves
2007-12-05 12:17 ` Corinna Vinschen
2007-12-05 19:19 ` Eli Zaretskii
2007-12-05 23:01 ` Pedro Alves
2007-12-06 1:06 ` Daniel Jacobowitz
2007-12-06 3:42 ` Pedro Alves
2007-12-06 4:25 ` Pedro Alves
2007-12-06 11:21 ` Corinna Vinschen
2007-12-07 13:54 ` Christopher Faylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000101c83593$89c0fcd0$9d42f670$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox