diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2007-01-04 20:12:15 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2007-01-04 20:12:15 +0000 |
commit | 2d0720d988230d947d5eee9245a7d2fc3f0eeb0a (patch) | |
tree | 71bb59981f532d851c6f809519a8c477663ecd4d /gdb/testsuite/gdb.mi/mi-var-cp.cc | |
parent | a028a6f5344b31f555a14d6769b61e6871317475 (diff) | |
download | gdb-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.cc')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-cp.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.cc b/gdb/testsuite/gdb.mi/mi-var-cp.cc index 6027051..8489b55 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cp.cc +++ b/gdb/testsuite/gdb.mi/mi-var-cp.cc @@ -17,10 +17,22 @@ void reference_update_tests () { + /*: BEGIN: reference_update :*/ int x = 167; + /*: mi_create_varobj "RX" "rx" "create varobj for rx" :*/ int& rx = x; + /*: mi_varobj_update RX {RX} "update RX (1)" + mi_check_varobj_value RX 167 "check RX: expect 167" + :*/ x = 567; + /*: mi_varobj_update RX {RX} "update RX (2)" + mi_check_varobj_value RX 567 "check RX: expect 567" + :*/ x = 567; + /*: mi_varobj_update RX {} "update RX (3)" + :*/ + + /*: END: reference_update :*/ } struct S { int i; int j; }; @@ -28,7 +40,26 @@ struct S2 : S {}; int base_in_reference_test (S2& s2) { + /*: BEGIN: base_in_reference :*/ return s2.i; + /*: + 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" + + :*/ + /*: END: base_in_reference :*/ } void base_in_reference_test_main () |