This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[rfa/testsuite/mi] Recognize a few incorrect outputs


The last two tests which timed out instead of failing on my system were
mi-var-display.exp and mi0-var-display.exp.  The regular expressions were
overly precise; the test would pass if the compiler's debug info marked the
first line of incr_a as being the assignment, but failed (and timed out) if
the first line was considered the opening brace.  I've made the latter case
a FAIL for now, since it means we stop before we can validly get a
backtrace.  After the attached patch, GCC 3.0 passes the test and GCC 2.95.3
fails it without a timeout (both i386-linux).

For the curious, before this and the two other patches I've submitted in the
past 24 hours, a testsuite run took 40:42.40.  Now it takes 5:46.87.  I like
this much better.  It could be cut down somewhat more, I expect:
	91.81s user 22.74s system 33% cpu
but removing sleeps is somewhat risky and we have no good way for sub-second
sleeps; and they're probably inappropriate on remote targets anyway.

<gripe>
A lot of GDB tests seem to be written with only pass and timeout
alternatives, or only with overly-specialized fails.  The hypocrite-alert
readers of this message will note that I'm guilty of the same thing; this is
Just Enough to make them catch a few errors I could think of, not enough to
recognize completely wrong output.  Someday, someone more motivated than I
should clean this up.
</gripe>

Is this OK to commit?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2001-09-28  Daniel Jacobowitz  <drow@mvista.com>

	* gdb.mi/mi-var-display.exp (continue to incr_a):  Recognize
	some incorrect output instead of timing out.
	* gdb.mi/mi-var-display.exp (continue to incr_a):  Likewise.

Index: gdb.mi/mi-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v
retrieving revision 1.5
diff -u -r1.5 mi-var-display.exp
--- mi-var-display.exp	2001/08/19 01:23:43	1.5
+++ mi-var-display.exp	2001/09/28 19:03:41
@@ -591,6 +591,10 @@
     -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" {
 	pass "continue to incr_a"
     }
+    -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"8\[345\]\"\}\r\n$mi_gdb_prompt$" {
+	# Compiler debug info is wrong...
+	fail "continue to incr_a"
+    }
     timeout {
 	fail "continue to incr_a (timeout)"
     }
Index: gdb.mi/mi0-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-var-display.exp,v
retrieving revision 1.4
diff -u -r1.4 mi0-var-display.exp
--- mi0-var-display.exp	2001/08/19 01:23:43	1.4
+++ mi0-var-display.exp	2001/09/28 19:03:42
@@ -591,6 +591,10 @@
     -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\{\{name=\"a\",value=\"2\.*\"\}\},file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" {
 	pass "continue to incr_a"
     }
+    -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\{\{name=\"a\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"8\[345\]\"\}\r\n$mi_gdb_prompt$" {
+	# Compiler debug info is wrong...
+	fail "continue to incr_a"
+    }
     timeout {
 	fail "continue to incr_a (timeout)"
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]