[v2,7/8] Fix test names starting with uppercase using multi-line gdb_test_multiple

Message ID 1480107244-1484-8-git-send-email-lgustavo@codesourcery.com
State New, archived
Headers

Commit Message

Luis Machado Nov. 25, 2016, 8:54 p.m. UTC
  This fixes offender testcases that have test names starting with uppercase
when using gdb_test_multiple in a multi-line construct.

gdb/testsuite/ChangeLog
2016-11-25  Luis Machado  <lgustavo@codesourcery.com>

	Fix test names starting with uppercase throughout the files.

	* gdb/testsuite/gdb.cp/gdb2495.exp
---
 gdb/testsuite/gdb.cp/gdb2495.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Pedro Alves Nov. 30, 2016, 8:47 p.m. UTC | #1
On 11/25/2016 08:54 PM, Luis Machado wrote:
> This fixes offender testcases that have test names starting with uppercase
> when using gdb_test_multiple in a multi-line construct.
> 
> gdb/testsuite/ChangeLog
> 2016-11-25  Luis Machado  <lgustavo@codesourcery.com>
> 
> 	Fix test names starting with uppercase throughout the files.
> 
> 	* gdb/testsuite/gdb.cp/gdb2495.exp

Drop "gdb/testsuite/", and LGTM, but ...

> ---
>  gdb/testsuite/gdb.cp/gdb2495.exp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
> index dff5977..7e4dfa8 100644
> --- a/gdb/testsuite/gdb.cp/gdb2495.exp
> +++ b/gdb/testsuite/gdb.cp/gdb2495.exp
> @@ -95,7 +95,7 @@ gdb_test "info breakpoints" \
>  
>  # Turn off this new behaviour.
>  gdb_test_multiple "set unwind-on-terminating-exception off" \
> -    "Turn unwind-on-terminating-exception off" {
> +    "turn unwind-on-terminating-exception off" {
>      -re "$gdb_prompt $" {pass "set unwinn-on-terminating-exception off"}
>      timeout {fail "(timeout) set unwind-on-terminating-exception off"}
>  }

... I think this could just be:

 gdb_test "set unwind-on-terminating-exception off" ""

?

I'd end up fixing two extra things:

 - note the typo in the pass case: "unwiNN"
 - odd "(timeout)" print position.  timeout handling it not necessary
   at all with gdb_test_multiple, even.

Thanks,
Pedro Alves
  
Luis Machado Nov. 30, 2016, 9:05 p.m. UTC | #2
On 11/30/2016 02:47 PM, Pedro Alves wrote:
> On 11/25/2016 08:54 PM, Luis Machado wrote:
>> This fixes offender testcases that have test names starting with uppercase
>> when using gdb_test_multiple in a multi-line construct.
>>
>> gdb/testsuite/ChangeLog
>> 2016-11-25  Luis Machado  <lgustavo@codesourcery.com>
>>
>> 	Fix test names starting with uppercase throughout the files.
>>
>> 	* gdb/testsuite/gdb.cp/gdb2495.exp
>
> Drop "gdb/testsuite/", and LGTM, but ...
>
>> ---
>>  gdb/testsuite/gdb.cp/gdb2495.exp | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
>> index dff5977..7e4dfa8 100644
>> --- a/gdb/testsuite/gdb.cp/gdb2495.exp
>> +++ b/gdb/testsuite/gdb.cp/gdb2495.exp
>> @@ -95,7 +95,7 @@ gdb_test "info breakpoints" \
>>
>>  # Turn off this new behaviour.
>>  gdb_test_multiple "set unwind-on-terminating-exception off" \
>> -    "Turn unwind-on-terminating-exception off" {
>> +    "turn unwind-on-terminating-exception off" {
>>      -re "$gdb_prompt $" {pass "set unwinn-on-terminating-exception off"}
>>      timeout {fail "(timeout) set unwind-on-terminating-exception off"}
>>  }
>
> ... I think this could just be:
>
>  gdb_test "set unwind-on-terminating-exception off" ""
>

gdb_test_no_output then? It doesn't check for any output other than the 
prompt.

> ?
>
> I'd end up fixing two extra things:
>
>  - note the typo in the pass case: "unwiNN"
>  - odd "(timeout)" print position.  timeout handling it not necessary
>    at all with gdb_test_multiple, even.

I see more occurrences of expecting timeouts where they're not needed. 
I'll fix in a follow-on patch.
  
Pedro Alves Nov. 30, 2016, 10:14 p.m. UTC | #3
On 11/30/2016 09:05 PM, Luis Machado wrote:

> gdb_test_no_output then? It doesn't check for any output other than the
> prompt.

'-re "$gdb_prompt $"' implicitly matches whatever might come before
the prompt too, but yeah, that'd be better even, assuming the command
doesn't output anything, which is probably true.

OK with that change.

> 
>> ?
>>
>> I'd end up fixing two extra things:
>>
>>  - note the typo in the pass case: "unwiNN"
>>  - odd "(timeout)" print position.  timeout handling it not necessary
>>    at all with gdb_test_multiple, even.
> 
> I see more occurrences of expecting timeouts where they're not needed.
> I'll fix in a follow-on patch.

Thanks much!

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
index dff5977..7e4dfa8 100644
--- a/gdb/testsuite/gdb.cp/gdb2495.exp
+++ b/gdb/testsuite/gdb.cp/gdb2495.exp
@@ -95,7 +95,7 @@  gdb_test "info breakpoints" \
 
 # Turn off this new behaviour.
 gdb_test_multiple "set unwind-on-terminating-exception off" \
-    "Turn unwind-on-terminating-exception off" {
+    "turn unwind-on-terminating-exception off" {
     -re "$gdb_prompt $" {pass "set unwinn-on-terminating-exception off"}
     timeout {fail "(timeout) set unwind-on-terminating-exception off"}
 }