Unbuffer all tests that rely on stdio
authorPedro Alves <palves@redhat.com>
Wed, 29 Jul 2015 10:09:45 +0000 (11:09 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 29 Jul 2015 10:09:45 +0000 (11:09 +0100)
commitdedad4e3d2ed1d6ecdb89422fc0baa028021f19d
tree2a50dafe48cf46b23fc11fe8474981498f0a3be2
parent58789a917b7eed57c5200ec0a4d8a2fc44efc64c
Unbuffer all tests that rely on stdio

This forces all tests that rely on stdio to be unbuffered, like
interrupt.exp was adjusted in 6f98576f.

To recap, in some scenarios, GDB or GDBserver can be spawned with
input _not_ connected to a tty, and then tests that rely on stdio fail
with timeouts, because the inferior's stdout and stderr streams end up
fully buffered.  Calling gdb_unbuffer_output forces output to be
unbuffered.

See https://sourceware.org/ml/gdb-patches/2015-02/msg00809.html and
https://sourceware.org/ml/gdb-patches/2015-02/msg00819.html.

Tested on x86_64 Fedora 20, native, and against a remote gdbserver
board file that connects to the target with ssh, with and without -t
(create pty).

gdb/testsuite/ChangeLog:
2015-07-29  Pedro Alves  <palves@redhat.com>

* gdb.base/call-ar-st.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/call-rt-st.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/call-strs.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/call-strs.exp: Adjust to step over the
gdb_unbuffer_output call.
* gdb.base/catch-gdb-caused-signals.c: Include
"../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/dprintf.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/ending-run.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/run.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/shlib-call.exp: Adjust to step over the
gdb_unbuffer_output call.
* gdb.base/shmain.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/sizeof.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/varargs.c: Include "../lib/unbuffer_output.c".
(main): Rename to ...
(test): ... this.
(main): Reimplement.
* gdb.base/varargs.exp: Run to test instead of to main.
* gdb.mi/mi-dprintf.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
16 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/call-ar-st.c
gdb/testsuite/gdb.base/call-rt-st.c
gdb/testsuite/gdb.base/call-strs.c
gdb/testsuite/gdb.base/call-strs.exp
gdb/testsuite/gdb.base/catch-gdb-caused-signals.c
gdb/testsuite/gdb.base/dprintf.c
gdb/testsuite/gdb.base/ending-run.c
gdb/testsuite/gdb.base/run.c
gdb/testsuite/gdb.base/shlib-call.exp
gdb/testsuite/gdb.base/shmain.c
gdb/testsuite/gdb.base/sizeof.c
gdb/testsuite/gdb.base/sizeof.exp
gdb/testsuite/gdb.base/varargs.c
gdb/testsuite/gdb.base/varargs.exp
gdb/testsuite/gdb.mi/mi-dprintf.c