public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  tromey/exception-improvements: add test cases for "catch throw REGEXP"
@ 2013-03-04 21:35 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2013-03-04 21:35 UTC (permalink / raw)
  To: archer-commits

The branch, tromey/exception-improvements has been updated
       via  14da3747d266a05e5dc4cb035a4bed27095f45b3 (commit)
       via  1ab94d45059b73f3e5d86b76610bf548f7a4eb5f (commit)
      from  3169700d5559c1de86de44260312218ab06fda9d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 14da3747d266a05e5dc4cb035a4bed27095f45b3
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 14:35:30 2013 -0700

    add test cases for "catch throw REGEXP"

commit 1ab94d45059b73f3e5d86b76610bf548f7a4eb5f
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 11:42:03 2013 -0700

    split libstdc++ probe testing into a new proc

-----------------------------------------------------------------------

Summary of changes:
 gdb/testsuite/gdb.cp/exceptprint.exp |   31 ++++++++++++++++++++++---------
 gdb/testsuite/lib/gdb.exp            |   18 ++++++++++++++++++
 2 files changed, 40 insertions(+), 9 deletions(-)

First 500 lines of diff:
diff --git a/gdb/testsuite/gdb.cp/exceptprint.exp b/gdb/testsuite/gdb.cp/exceptprint.exp
index 3f993d4..d9f4fd5 100644
--- a/gdb/testsuite/gdb.cp/exceptprint.exp
+++ b/gdb/testsuite/gdb.cp/exceptprint.exp
@@ -27,15 +27,7 @@ if {![runto_main]} {
     return -1
 }
 
-set ok 0
-gdb_test_multiple "info probe" "check for stap probe in libstdc++" {
-    -re ".*libstdcxx.*catch.*\r\n$gdb_prompt $" {
-	set ok 1
-    }
-    -re "\r\n$gdb_prompt $" {
-    }
-}
-if {!$ok} {
+if {![skip_libstdcxx_probe_tests]} {
     untested "could not find libstdc++ stap probe"
     return -1
 }
@@ -79,3 +71,24 @@ do_exceptprint_tests string "$hex \"hi bob\""
 do_exceptprint_tests int 23
 do_exceptprint_tests struct "{mv = 77}"
 do_exceptprint_tests "reference to struct" "{mv = 77}"
+
+
+delete_breakpoints
+
+if {![runto_main]} {
+    return -1
+}
+
+gdb_test "catch catch int if \$_exception == 23" \
+    "Catchpoint \[0-9\]+ \\(catch\\)" \
+    "catch catch"
+gdb_test "catch throw int if \$_exception == 23" \
+    "Catchpoint \[0-9\]+ \\(throw\\)" \
+    "catch throw"
+gdb_test "catch rethrow int if \$_exception == 23" \
+    "Catchpoint \[0-9\]+ \\(rethrow\\)" \
+    "catch rethrow"
+
+# This tests both the case where the regular expression does not
+# match, and the case where it does.
+do_exceptprint_tests int 23
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 8b16b38..2177750 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2240,6 +2240,24 @@ proc skip_unwinder_tests {} {
     return $ok
 }
 
+# Return 0 if we should skip tests that require the libstdc++ stap
+# probes.  This must be invoked while gdb is running, after shared
+# libraries have been loaded.
+
+proc skip_libstdcxx_probe_tests {} {
+    global gdb_prompt
+
+    set ok 0
+    gdb_test_multiple "info probe" "check for stap probe in libstdc++" {
+	-re ".*libstdcxx.*catch.*\r\n$gdb_prompt $" {
+	    set ok 1
+	}
+	-re "\r\n$gdb_prompt $" {
+	}
+    }
+    return $ok
+}
+
 set compiler_info		"unknown"
 set gcc_compiled		0
 set hp_cc_compiler		0


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-04 21:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-04 21:35 [SCM] tromey/exception-improvements: add test cases for "catch throw REGEXP" tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).