Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] gdb/testsuite/gdb.base/fileio.exp patch for cygwin
@ 2007-12-03 10:02 Pierre Muller
  2007-12-04 23:50 ` Pedro Alves
  0 siblings, 1 reply; 12+ messages in thread
From: Pierre Muller @ 2007-12-03 10:02 UTC (permalink / raw)
  To: gdb-patches

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 ();



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-12-07 13:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-03 10:02 [RFC] gdb/testsuite/gdb.base/fileio.exp patch for cygwin Pierre Muller
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox