aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/python.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-09-20 20:54:11 +0000
committerTom Tromey <tromey@redhat.com>2012-09-20 20:54:11 +0000
commitd7de8e3ce962db7df6f4107101a87f53129e98eb (patch)
treeef282d5c25697b0975283b61cae01f4013798332 /gdb/testsuite/gdb.python/python.exp
parent05eade73e1f590a99d2c6ac2359e62c0765f9ca4 (diff)
downloadgdb-d7de8e3ce962db7df6f4107101a87f53129e98eb.zip
gdb-d7de8e3ce962db7df6f4107101a87f53129e98eb.tar.gz
gdb-d7de8e3ce962db7df6f4107101a87f53129e98eb.tar.bz2
* NEWS: Update.
* python/python.c (finalize_python): New function. (_initialize_python): Make a final cleanup. testsuite * gdb.python/python.exp: Test atexit.register.
Diffstat (limited to 'gdb/testsuite/gdb.python/python.exp')
-rw-r--r--gdb/testsuite/gdb.python/python.exp18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index 9f29e3a..6f0ce1c 100644
--- a/gdb/testsuite/gdb.python/python.exp
+++ b/gdb/testsuite/gdb.python/python.exp
@@ -141,6 +141,24 @@ gdb_test "python print a" ".*aliases -- Aliases of other commands.*" "verify hel
gdb_py_test_silent_cmd "python nothread = gdb.selected_thread()" "Attempt to aquire thread with no inferior" 1
gdb_test "python print nothread == None" "True" "Ensure that no threads are returned"
+gdb_py_test_multiple "register atexit function" \
+ "python" "" \
+ "import atexit" "" \
+ "def printit(arg):" "" \
+ " print arg" "" \
+ "atexit.register(printit, 'good bye world')" "" \
+ "end" ""
+
+send_gdb "quit\n"
+gdb_expect {
+ -re "good bye world" {
+ pass "atexit handling"
+ }
+ default {
+ fail "atexit handling"
+ }
+}
+
# Start with a fresh gdb.
clean_restart ${testfile}