+2010-05-20 Pedro Alves <pedro@codesourcery.com>
+ Joel Brobecker <brobecker@adacore.com>
+
+ * lib/gdb.exp (gdb_test_no_output): New function.
+ * lib/gdb.ada/arrayidx.exp: Use gdb_test_no_output instead of gdb_test
+ when testing commands that should produce no output.
+
2010-05-19 Michael Snyder <msnyder@vmware.com>
* gdb.base/whatis.exp: Replace send_gdb with gdb_test.
# First, print all the arrays without indexes
-gdb_test "set print array-indexes off" \
- "" \
- "set print array-indexes to off"
+gdb_test_no_output "set print array-indexes off"
gdb_test "print one_two_three" \
"= \\(1, 2, 3\\)" \
# Next, print all the arrays with the indexes
-gdb_test "set print array-indexes on" \
- "" \
- "set print array-indexes to on"
+gdb_test_no_output "set print array-indexes on"
gdb_test "print one_two_three" \
"= \\(1 => 1, 2 => 2, 3 => 3\\)" \
}
}]
}
+
+# gdb_test_no_output COMMAND MESSAGE
+# Send a command to GDB and verify that this command generated no output.
+#
+# See gdb_test_multiple for a description of the COMMAND and MESSAGE
+# parameters. If MESSAGE is ommitted, then COMMAND will be used as
+# the message.
+
+proc gdb_test_no_output { args } {
+ global gdb_prompt
+ set command [lindex $args 0]
+ if [llength $args]>1 then {
+ set message [lindex $args 1]
+ } else {
+ set message $command
+ }
+
+ set command_regex [string_to_regexp $command]
+ gdb_test_multiple $command $message {
+ -re "^$command_regex\r\n$gdb_prompt $" {
+ pass $message
+ }
+ }
+}
+
\f
# Test that a command gives an error. For pass or fail, return
# a 1 to indicate that more tests can proceed. However a timeout