aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2013-09-04 23:49:21 +0000
committerDoug Evans <dje@google.com>2013-09-04 23:49:21 +0000
commit314bb8c368cda35590c589cafae49b05dd434513 (patch)
tree045ea9e61fcc6ed37645764c9e90a48636ca247e /gdb/testsuite
parent89e63ee47a55271506d68f24b25a4a2094ab346f (diff)
downloadgdb-314bb8c368cda35590c589cafae49b05dd434513.zip
gdb-314bb8c368cda35590c589cafae49b05dd434513.tar.gz
gdb-314bb8c368cda35590c589cafae49b05dd434513.tar.bz2
* gdb.python/py-events.py (exit_handler): Verify we get the expected
event. (continue_handler, new_objfile_handler): Ditto. (test_events): Rename command to "test-events". (test_newobj_events): Rename command to "test-objfile-events". * gdb.python/py-events.exp: Update. * gdb.python/py-evsignal.exp: Update. * gdb.python/py-evthreads.exp: Update.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog9
-rw-r--r--gdb/testsuite/gdb.python/py-events.exp4
-rw-r--r--gdb/testsuite/gdb.python/py-events.py24
-rw-r--r--gdb/testsuite/gdb.python/py-evsignal.exp2
-rw-r--r--gdb/testsuite/gdb.python/py-evthreads.exp2
5 files changed, 24 insertions, 17 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index cfa5590..499784e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,14 @@
2013-09-04 Doug Evans <dje@google.com>
+ * gdb.python/py-events.py (exit_handler): Verify we get the expected
+ event.
+ (continue_handler, new_objfile_handler): Ditto.
+ (test_events): Rename command to "test-events".
+ (test_newobj_events): Rename command to "test-objfile-events".
+ * gdb.python/py-events.exp: Update.
+ * gdb.python/py-evsignal.exp: Update.
+ * gdb.python/py-evthreads.exp: Update.
+
* gdb.base/enumval.c (ZERO): New enum value.
(main): Use it
* gdb.base/enumval.exp: Test ability to print ZERO.
diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp
index 7bd6562..390a2ba 100644
--- a/gdb/testsuite/gdb.python/py-events.exp
+++ b/gdb/testsuite/gdb.python/py-events.exp
@@ -45,7 +45,7 @@ if { [skip_python_tests] } { continue }
gdb_test_no_output "python exec (open ('${pyfile}').read ())" ""
-gdb_test "Test_Newobj_Events" "New ObjectFile Event tester registered." "Register new objfile event handler"
+gdb_test "test-objfile-events" "Object file events registered."
gdb_breakpoint "main" {temporary}
@@ -53,7 +53,7 @@ gdb_test "run" ".*event type: new_objfile.*new objfile name.*" "New objfile noti
gdb_test_no_output "set detach-on-fork off" ""
-gdb_test "Test_Events" "Event testers registered."
+gdb_test "test-events" "Event testers registered."
gdb_breakpoint "first"
gdb_breakpoint "first"
diff --git a/gdb/testsuite/gdb.python/py-events.py b/gdb/testsuite/gdb.python/py-events.py
index bfab78e..6c6dcda 100644
--- a/gdb/testsuite/gdb.python/py-events.py
+++ b/gdb/testsuite/gdb.python/py-events.py
@@ -40,31 +40,29 @@ def breakpoint_stop_handler (event):
print ("all threads stopped")
def exit_handler (event):
- if (isinstance (event, gdb.ExitedEvent)):
- print ("event type: exit")
+ assert (isinstance (event, gdb.ExitedEvent))
+ print ("event type: exit")
print ("exit code: %d" % (event.exit_code))
print ("exit inf: %d" % (event.inferior.num))
print ("dir ok: %s" % str('exit_code' in dir(event)))
def continue_handler (event):
- if (isinstance (event, gdb.ContinueEvent)):
- print ("event type: continue")
+ assert (isinstance (event, gdb.ContinueEvent))
+ print ("event type: continue")
if ( event.inferior_thread is not None) :
print ("thread num: %s" % (event.inferior_thread.num))
def new_objfile_handler (event):
- if (isinstance (event, gdb.NewObjFileEvent)):
- print ("event type: new_objfile")
- if (event.new_objfile is not None):
- print ("new objfile name: %s" % (event.new_objfile.filename))
- else:
- print ("new objfile is None")
+ assert (isinstance (event, gdb.NewObjFileEvent))
+ print ("event type: new_objfile")
+ print ("new objfile name: %s" % (event.new_objfile.filename))
+ print ("inferior number: %d" % (event.inferior.num))
class test_events (gdb.Command):
"""Test events."""
def __init__ (self):
- gdb.Command.__init__ (self, "test_events", gdb.COMMAND_STACK)
+ gdb.Command.__init__ (self, "test-events", gdb.COMMAND_STACK)
def invoke (self, arg, from_tty):
gdb.events.stop.connect (signal_stop_handler)
@@ -79,10 +77,10 @@ class test_newobj_events (gdb.Command):
"""NewObj events."""
def __init__ (self):
- gdb.Command.__init__ (self, "test_newobj_events", gdb.COMMAND_STACK)
+ gdb.Command.__init__ (self, "test-objfile-events", gdb.COMMAND_STACK)
def invoke (self, arg, from_tty):
gdb.events.new_objfile.connect (new_objfile_handler)
- print ("New ObjectFile Event tester registered.")
+ print ("Object file events registered.")
test_newobj_events ()
diff --git a/gdb/testsuite/gdb.python/py-evsignal.exp b/gdb/testsuite/gdb.python/py-evsignal.exp
index c71cc6a..d702742 100644
--- a/gdb/testsuite/gdb.python/py-evsignal.exp
+++ b/gdb/testsuite/gdb.python/py-evsignal.exp
@@ -33,7 +33,7 @@ if { [skip_python_tests] } { continue }
gdb_test_no_output "python exec (open ('${pyfile}').read ())" ""
-gdb_test "Test_Events" "Event testers registered."
+gdb_test "test-events" "Event testers registered."
gdb_test_no_output "set non-stop on"
gdb_test_no_output "set target-async on"
diff --git a/gdb/testsuite/gdb.python/py-evthreads.exp b/gdb/testsuite/gdb.python/py-evthreads.exp
index 8bf8ee9..a25df46 100644
--- a/gdb/testsuite/gdb.python/py-evthreads.exp
+++ b/gdb/testsuite/gdb.python/py-evthreads.exp
@@ -38,7 +38,7 @@ if { [skip_python_tests] } { continue }
gdb_test_no_output "python exec (open ('${pyfile}').read ())" ""
-gdb_test "Test_Events" "Event testers registered."
+gdb_test "test-events" "Event testers registered."
gdb_test_no_output "set non-stop on"
gdb_test_no_output "set target-async on"