[RFA] gdb.mi/mi2-basics.exp re-aligned with mi-basics.exp

Denis PILAT denis.pilat@st.com
Wed Oct 15 11:22:00 GMT 2008


Is there any reason why we do not test -inferior-tty commands on 
gdb.mi/mi2-basics.exp ?
If no I propose to activate these tests, like in mi-basics.exp.

I'll take this opportunity to fix a typo on my previous commit where I wrote
gdb.mi/mb-ctor.exp in the place of gdb.cp/mb-ctor.exp. (that was to fix 
a typo ;)


-- 
Denis

2008-10-15  Denis Pilat  <denis.pilat@st.com>

	* gdb.mi/mi2-basics.exp: Activate -inferior-tty tests like 
	in mi2-basics.exp.
	(test_setshow_inferior_tty): new function.



Index: gdb.mi/mi2-basics.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-basics.exp,v
retrieving revision 1.12
diff -u -p -r1.12 mi2-basics.exp
--- gdb.mi/mi2-basics.exp       6 Aug 2008 12:52:08 -0000       1.12
+++ gdb.mi/mi2-basics.exp       15 Oct 2008 11:11:49 -0000
@@ -30,7 +30,7 @@ load_lib mi-support.exp
 set MIFLAGS "-i=mi2"

 gdb_exit
-if [mi_gdb_start] {
+if [mi_gdb_start separate-inferior-tty] {
     continue
 }

@@ -174,8 +174,8 @@ proc test_dir_specification {} {
 proc test_cwd_specification {} {
     global mi_gdb_prompt
     global objdir
-    global subdir
     global escapedobjdir
+    global subdir

     # Change the working directory, then print the current working directory
     # Tests:
@@ -238,12 +238,51 @@ proc test_path_specification {} {

 }

+proc test_setshow_inferior_tty {} {
+    global mi_gdb_prompt
+    global mi_inferior_tty_name
+
+    # Test that the commands,
+    #   -inferior-tty-set
+    #   -inferior-tty-show
+    # are setting/getting the same data in GDB.
+
+    mi_gdb_test "301-inferior-tty-show" \
+               "301\\\^done,inferior_tty_terminal=\"$mi_inferior_tty_name\"" \
+               "initial tty is mi_inferior_tty_name"
+
+    mi_gdb_test "302-inferior-tty-set /dev/pts/1" \
+               "302\\\^done" \
+               "set tty to /dev/pts/1"
+
+    mi_gdb_test "303-inferior-tty-show" \
+               "303\\\^done,inferior_tty_terminal=\"/dev/pts/1\"" \
+               "tty was set correctly"
+
+    mi_gdb_test "304-inferior-tty-set" \
+               "304\\\^done" \
+               "set tty to the empty string"
+
+    mi_gdb_test "305-inferior-tty-show" \
+               "305\\\^done" \
+               "make sure tty is empty"
+
+    mi_gdb_test "306-inferior-tty-set $mi_inferior_tty_name" \
+               "306\\\^done" \
+               "set tty to mi_inferior_tty_name (the way it was)"
+
+    mi_gdb_test "307-inferior-tty-show" \
+               "307\\\^done,inferior_tty_terminal=\"$mi_inferior_tty_name\"" \
+               "verify tty is correct"
+}
+
 if [test_mi_interpreter_selection] {
   test_exec_and_symbol_mi_operatons
   test_breakpoints_deletion
   test_dir_specification
   test_cwd_specification
   test_path_specification
+  test_setshow_inferior_tty
 }

 mi_gdb_exit




More information about the Gdb-patches mailing list