When looking at some failures of gdb.linespec/cp-completion-aliases.exp,
I noticed that when a completion test will fail, it always fails with a
timeout. This is because most completion tests use gdb_test_multiple
and only add a check for the correct output. This commit adds new
options for both, tab and command completion.
For command completion, the new option will check if the prompt was
printed, and fail in this case. This is enough to know that the test has
failed because the check comes after the PASS path. For tab completion,
we have to check if GDB outputted more than just the input line, because
sometimes GDB would have printed a partial line before finishing with
the correct completion.
Approved-By: Tom Tromey <tom@tromey.com>
-re "^$line_re$completion::bell_re$" {
pass "$test"
}
+ -re "$line_re\[^ \]+ $" {
+ fail "$test"
+ }
}
clear_input_line $test
set test "tab complete \"$input_line\""
send_gdb "$input_line\t"
+ set partial_complete [string_to_regexp $input_line]
set res 1
gdb_test_multiple "" "$test" {
-re "^$complete_line_re$append_char_re$" {
pass "$test"
}
+ -re "$partial_complete\[^ \]+ $" {
+ fail "$test"
+ }
timeout {
fail "$test (timeout)"
set res -1
}
}
}
+ -re "${maybe_bell}\r\n.+\r\n$gdb_prompt $" {
+ fail "$test"
+ }
}
}
}
-re "^$cmd_re\r\n$complete_line_re\r\n$gdb_prompt $" {
pass $test
}
+ -re "$gdb_prompt $" {
+ fail "$test"
+ }
}
}
-re "^$cmd_re\r\n$expected_re$gdb_prompt $" {
pass $test
}
+ -re "$gdb_prompt $" {
+ fail "$test"
+ }
}
}