This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING][PATCH] gnu_vector.exp: Avoid some more known FAILs
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Ulrich Weigand <uweigand at de dot ibm dot com>, Yao Qi <qiyaoltc at gmail dot com>
- Date: Thu, 13 Aug 2015 17:49:01 +0200
- Subject: Re: [PING][PATCH] gnu_vector.exp: Avoid some more known FAILs
- Authentication-results: sourceware.org; auth=none
- References: <878u9hwxa1 dot fsf at br87z6lw dot de dot ibm dot com> <55CB2870 dot 5050903 at redhat dot com>
On Wed, Aug 12 2015, Pedro Alves wrote:
> On 08/11/2015 06:27 PM, Andreas Arnez wrote:
>> +gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test {
>> + -re "#0 .* main .*$gdb_prompt $" {
>> + if { $ok } {
>> + pass $test
>> + gdb_test "continue" "4 2 7 6\r\n.*" "verify vector return value"
>> + }
>> + }
>> + -re "The location .* is unknown.\r\n.* return value .* will be ignored.\r\n" {
>> + kfail "gdb/8549" $test
>> + set ok 0
>> + exp_continue
>> + }
>> + -re "Make add_some_intvecs return now. .y or n. $" {
>> + send_gdb "y\n"
>> + exp_continue
>> + }
>> +}
>
> If this fails without matching the first pattern above, then we can
> end up with a duplicate test message (kfail + fail).
That's true. Thanks for pointing out.
> Maybe do something like this instead:
>
> set test "set vector return value"
> set should_kfail 0
> set finished 0
> gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test {
> -re "#0 .* main .*$gdb_prompt $" {
> set finished 1
> }
> -re "The location .* is unknown.\r\n.* return value .* will be ignored.\r\n" {
> set should_kfail 1
> exp_continue
> }
> -re "Make add_some_intvecs return now. .y or n. $" {
> send_gdb "y\n"
> exp_continue
> }
> }
> if { $finished } {
> if { $should_kfail } {
> kfail "gdb/8549" $test
> } else {
> pass $test
> gdb_test "continue" "4 2 7 6\r\n.*" "verify vector return value"
> }
> }
Right, that would be an option. After thinking about this a bit I
slightly prefer to go even one step further, like in the approach below.
In my view, it more clearly separates the steps and is more easily
extensible at the end. But maybe I've been thinking about this too much
already ;-)
OK with this change?
set test "return from vector-valued function"
set should_kfail 0
gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test {
-re "#0 .* main .*$gdb_prompt $" {
pass $test
}
-re "The location .* is unknown.\r\n.* return value .* will be ignored.\r\n" {
set should_kfail 1
exp_continue
}
-re "Make add_some_intvecs return now. .y or n. $" {
send_gdb "y\n"
exp_continue
}
}
set test "verify vector return value"
gdb_test_multiple "continue" $test {
-re "4 2 7 6\r\n.*$gdb_prompt $" {
pass $test
}
-re "10 20 48 72\r\n.*$gdb_prompt $" {
if { $should_kfail } {
kfail "gdb/8549" $test
} else {
fail $test
}
}
}