blarsen / rpms / gdb

Forked from rpms/gdb 2 years ago
Clone
Jan Kratochvil 7c0a903
ad20e5eb15d037a31e3b484e9f57542dc927c0a9
Jan Kratochvil 7c0a903
http://sourceware.org/ml/gdb-cvs/2010-10/msg00005.html
Jan Kratochvil 7c0a903
Jan Kratochvil 7c0a903
### src/gdb/testsuite/ChangeLog	2010/09/30 18:58:07	1.2462
Jan Kratochvil 7c0a903
### src/gdb/testsuite/ChangeLog	2010/10/01 17:03:49	1.2463
Jan Kratochvil 7c0a903
## -1,3 +1,19 @@
Jan Kratochvil 7c0a903
+2010-10-01  Doug Evans  <dje@google.com>
Jan Kratochvil 7c0a903
+
Jan Kratochvil 7c0a903
+	* lib/gdb-python.exp: New file.
Jan Kratochvil 7c0a903
+	* gdb.python/py-block.exp: Use it.
Jan Kratochvil 7c0a903
+	* gdb.python/py-breakpoint.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/py-frame.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/py-inferior.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/py-param.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/py-prettyprint.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/py-shared.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/py-symbol.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/py-symtab.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/py-type.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/py-value.exp: Ditto.
Jan Kratochvil 7c0a903
+	* gdb.python/python.exp: Ditto.
Jan Kratochvil 7c0a903
+
Jan Kratochvil 7c0a903
 2010-09-30  Tom Tromey  <tromey@redhat.com>
Jan Kratochvil 7c0a903
 
Jan Kratochvil 7c0a903
 	* gdb.base/anon.exp: New file.
Jan Kratochvil 7c0a903
--- src/gdb/testsuite/lib/gdb-python.exp
Jan Kratochvil 7c0a903
+++ src/gdb/testsuite/lib/gdb-python.exp	2010-10-12 17:58:35.904468000 +0000
Jan Kratochvil 7c0a903
@@ -0,0 +1,47 @@
Jan Kratochvil 7c0a903
+# Copyright 2010 Free Software Foundation, Inc.
Jan Kratochvil 7c0a903
+
Jan Kratochvil 7c0a903
+# This program is free software; you can redistribute it and/or modify
Jan Kratochvil 7c0a903
+# it under the terms of the GNU General Public License as published by
Jan Kratochvil 7c0a903
+# the Free Software Foundation; either version 3 of the License, or
Jan Kratochvil 7c0a903
+# (at your option) any later version.
Jan Kratochvil 7c0a903
+#
Jan Kratochvil 7c0a903
+# This program is distributed in the hope that it will be useful,
Jan Kratochvil 7c0a903
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
Jan Kratochvil 7c0a903
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Jan Kratochvil 7c0a903
+# GNU General Public License for more details.
Jan Kratochvil 7c0a903
+#
Jan Kratochvil 7c0a903
+# You should have received a copy of the GNU General Public License
Jan Kratochvil 7c0a903
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Jan Kratochvil 7c0a903
+
Jan Kratochvil 7c0a903
+# Utilities for python-scripting related tests.
Jan Kratochvil 7c0a903
+
Jan Kratochvil 7c0a903
+# Run a command in GDB, and report a failure if a Python exception is thrown.
Jan Kratochvil 7c0a903
+# If report_pass is true, report a pass if no exception is thrown.
Jan Kratochvil 7c0a903
+
Jan Kratochvil 7c0a903
+proc gdb_py_test_silent_cmd { cmd name report_pass } {
Jan Kratochvil 7c0a903
+    global gdb_prompt
Jan Kratochvil 7c0a903
+
Jan Kratochvil 7c0a903
+    gdb_test_multiple $cmd $name {
Jan Kratochvil 7c0a903
+	-re "Traceback.*$gdb_prompt $" { fail $name }
Jan Kratochvil 7c0a903
+	-re "$gdb_prompt $"            { if $report_pass { pass $name } }
Jan Kratochvil 7c0a903
+    }
Jan Kratochvil 7c0a903
+}
Jan Kratochvil 7c0a903
+
Jan Kratochvil 7c0a903
+# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}...
Jan Kratochvil 7c0a903
+# Run a test named NAME, consisting of multiple lines of input.
Jan Kratochvil 7c0a903
+# After each input line INPUT, search for result line RESULT.
Jan Kratochvil 7c0a903
+# Succeed if all results are seen; fail otherwise.
Jan Kratochvil 7c0a903
+
Jan Kratochvil 7c0a903
+proc gdb_py_test_multiple { name args } {
Jan Kratochvil 7c0a903
+    global gdb_prompt
Jan Kratochvil 7c0a903
+    foreach {input result} $args {
Jan Kratochvil 7c0a903
+	if {[gdb_test_multiple $input "$name - $input" {
Jan Kratochvil 7c0a903
+	    -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" {
Jan Kratochvil 7c0a903
+		pass "$name - $input"
Jan Kratochvil 7c0a903
+	    }
Jan Kratochvil 7c0a903
+	}]} {
Jan Kratochvil 7c0a903
+	    return 1
Jan Kratochvil 7c0a903
+	}
Jan Kratochvil 7c0a903
+    }
Jan Kratochvil 7c0a903
+    return 0
Jan Kratochvil 7c0a903
+}