8sa1-binutils-gdb/gdb/testsuite/lib
Simon Marchi 60122dbef4 gdb/testsuite: make runto always emit a FAIL on internal error
I noticed that when a test uses `runto_main` and a GDB internal error
happens while running to main, no error or fail is emitted.  This is
because `runto_main` uses the `no-message` option of `runto`.

As a result, if a test fails to run to main and exits, no sign that
something went wrong is emitted.  For example, add this always-false
assertion to compute_frame_id:

    --- a/gdb/frame.c
    +++ b/gdb/frame.c
    @@ -545,6 +545,7 @@ static void
     compute_frame_id (struct frame_info *fi)
     {
       gdb_assert (!fi->this_id.p);
    +  gdb_assert (false);

       if (frame_debug)
         fprintf_unfiltered (gdb_stdlog, "{ compute_frame_id (fi=%d) ",

... and run gdb.dwarf2/dw2-align.exp.  No fail or sign that something
went wrong is shown.  It just appears as if the test gets skipped.

A developer introducing such a regression in this test today would
likely notice it, because we are used to diff-ing test results.  So we
would see some PASSes dispappear for no good reason and look into it.

But I find it worrysome for two reasons:

1. Scripts that analyze regressions (such as the one on the buildbot)
   may only look for new FAILs or new ERRORs.  It would probably miss
   this.
2. Imagine that we one day have a testsuite that runs cleanly (some
   people might already run subsets of the testsuite and expect it to
   all pass), we would just run the testsuite and check that there are
   no fails.  It would be easy to miss something like this.

In case of internal error, I suggest making `runto` emit a FAIL even if
`no-message` was passed.  This is different from other failure modes
that might be expected (whchi rightfully cause the test to simply be
skipped).  An internal error is always bad, so if it happens it should
noisily fail.

gdb/testsuite/ChangeLog:

	* lib/gdb.exp (runto): Always emit fail on internal error.

Change-Id: I6e6faed4868ea821541a23042b2d01c30058b0d3
2020-08-24 19:44:53 -04:00
..
ada.exp
append_gdb_boards_dir.exp
build-piece.exp
cache.exp
check-test-names.exp gdb/testsuite: Use 'array unset' instead of just 'unset' 2020-08-04 15:56:08 +01:00
cl_util.c
cl_util.h
compile-support.exp
compiler.c
compiler.cc
completion-support.exp Adjust command completion output when TUI is disabled 2020-06-23 09:33:31 -07:00
cp-support.exp
d-support.exp
data-structures.exp
dtrace.exp
dwarf.exp [gdb/symtab] Ignore DW_LNE_lo_user/DW_LNE_hi_user range 2020-08-03 16:59:20 +02:00
fortran.exp
future.exp [gdb/testsuite] Handle early_flags in gdb_default_target_compile 2020-06-30 09:23:09 +02:00
gdb-guile.exp Make test names unique in python.exp and guile.exp 2020-06-26 22:04:46 +02:00
gdb-python.exp Make test names unique in python.exp and guile.exp 2020-06-26 22:04:46 +02:00
gdb-utils.exp
gdb.exp gdb/testsuite: make runto always emit a FAIL on internal error 2020-08-24 19:44:53 -04:00
gdbserver-support.exp
gen-perf-test.exp
gnat_debug_info_test.adb
go.exp
jit-elf-helpers.exp
memory.exp
mi-support.exp
objc.exp
opencl_hostapp.c
opencl_kernel.cl
opencl.exp
pascal.exp gdb/testsuite: Prevent globals leaking between test scripts 2020-06-12 15:09:33 +02:00
pdtrace.in
perftest.exp
prelink-support.exp
prompt.exp
range-stepping-support.exp
read1.c
rust-support.exp
selftest-support.exp [gdb/testsuite] Fix captured_command_loop breakpoint in selftests 2020-07-29 18:16:26 +02:00
set_unbuffered_mode.c
sym-info-cmds.exp [gdb/testsuite] Fix gdb.fortran/info-modules.exp with gcc-4.8 2020-07-30 17:47:37 +02:00
trace-support.exp
tuiterm.exp
unbuffer_output.c
valgrind.exp [gdb/testsuite] Add gdb.base/valgrind-infcall-2.exp 2020-07-17 17:33:18 +02:00