aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/mi-var-cp.exp
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2007-01-04 20:12:15 +0000
committerVladimir Prus <vladimir@codesourcery.com>2007-01-04 20:12:15 +0000
commit2d0720d988230d947d5eee9245a7d2fc3f0eeb0a (patch)
tree71bb59981f532d851c6f809519a8c477663ecd4d /gdb/testsuite/gdb.mi/mi-var-cp.exp
parenta028a6f5344b31f555a14d6769b61e6871317475 (diff)
downloadgdb-2d0720d988230d947d5eee9245a7d2fc3f0eeb0a.zip
gdb-2d0720d988230d947d5eee9245a7d2fc3f0eeb0a.tar.gz
gdb-2d0720d988230d947d5eee9245a7d2fc3f0eeb0a.tar.bz2
Implement specification of MI tests as comments
in C and C++ sources. * lib/mi-support.exp (mi_autotest_data): New variable. (mi_autotest_source): New variable. (count_newlines, mi_prepare_inline_tests) (mi_get_inline_test, mi_continue_to_line) (mi_run_inline_test, mi_tbreak) (mi_send_resuming_command, mi_wait_for_stop): New functions. * gdb.mi/mi-var-cp.exp: Move most content to the C file. Run inline tests. * gdb.mi/mi-var-cp.cc: Define tests here.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-var-cp.exp')
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-cp.exp49
1 files changed, 3 insertions, 46 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.exp b/gdb/testsuite/gdb.mi/mi-var-cp.exp
index fea145f..7582301 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cp.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cp.exp
@@ -39,53 +39,10 @@ if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""
mi_gdb_load ${binfile}
-# Test that children of classes are properly reported
-
-mi_runto reference_update_tests
-
-mi_create_varobj "RX" "rx" "create varobj for rx"
-
-set x_assignment [gdb_get_line_number "x = 567;"]
-mi_next_to "reference_update_tests" {} ".*${srcfile}" [expr $x_assignment-1] \
- "step to x assignment"
-mi_next_to "reference_update_tests" {} ".*${srcfile}" [expr $x_assignment] \
- "step to x assignment"
-
-mi_varobj_update RX {RX} "update RX (1)"
-
-mi_check_varobj_value RX 167 "check RX: expect 167"
-
-# Execute the first 'x = 567' line.
-mi_next_to "reference_update_tests" {} ".*${srcfile}" [expr $x_assignment+1] \
- "step to x assignment"
-
-mi_varobj_update RX {RX} "update RX (2)"
-mi_check_varobj_value RX 567 "check RX: expect 567"
-
-# Execute the second 'x = 567' line.
-mi_next_to "reference_update_tests" {} ".*${srcfile}" [expr $x_assignment+2] \
- "step to x assignment"
-
-mi_varobj_update RX {} "update RX (3)"
-
-mi_runto base_in_reference_test
-
-mi_create_varobj "S2" "s2" "create varobj for s2"
-
-mi_list_varobj_children "S2" {{"S2.S" "S" "1" "S"}} "list children of s2"
-
-mi_list_varobj_children "S2.S" {{"S2.S.public" "public" "2"}} \
- "list children of s2.s"
-
-mi_list_varobj_children "S2.S.public"\
-{
- {"S2.S.public.i" "i" "0" "int"}
- {"S2.S.public.j" "j" "0" "int"}
-} "list children of s2.s.public"
-
-mi_check_varobj_value "S2.S.public.i" "67" "check S2.S.public.i"
-mi_check_varobj_value "S2.S.public.j" "89" "check S2.S.public.j"
+mi_prepare_inline_tests $srcfile
+mi_run_inline_test reference_update
+mi_run_inline_test base_in_reference
mi_gdb_exit
return 0