[2/3] Add a better diagnostic message in mi_gdb_test

Message ID 1473712054-30417-2-git-send-email-marc-andre.laperle@ericsson.com
State New, archived
Headers

Commit Message

Marc-Andre Laperle Sept. 12, 2016, 8:27 p.m. UTC
  When using mi_gdb_test, if it fails because of the presence of
unexpected output, the error message is only the message passed as
the argument with no indication that there was an unexpected output.
This change adds an additional text to the failure message to
indicate that there was an unexpected output.

gdb/testsuite/ChangeLog:

        * lib/mi-support.exp (mi_gdb_test): Add additional message
        for unexpected output.

Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
---
 gdb/testsuite/lib/mi-support.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Simon Marchi Oct. 20, 2016, 4:23 a.m. UTC | #1
On 2016-09-12 16:27, Marc-Andre Laperle wrote:
> When using mi_gdb_test, if it fails because of the presence of
> unexpected output, the error message is only the message passed as
> the argument with no indication that there was an unexpected output.
> This change adds an additional text to the failure message to
> indicate that there was an unexpected output.
> 
> gdb/testsuite/ChangeLog:
> 
>         * lib/mi-support.exp (mi_gdb_test): Add additional message
>         for unexpected output.
> 
> Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
> ---
>  gdb/testsuite/lib/mi-support.exp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/lib/mi-support.exp 
> b/gdb/testsuite/lib/mi-support.exp
> index 7c2bb3e..25995cf 100644
> --- a/gdb/testsuite/lib/mi-support.exp
> +++ b/gdb/testsuite/lib/mi-support.exp
> @@ -824,7 +824,7 @@ proc mi_gdb_test { args } {
>  	}
>  	 -re ".*$mi_gdb_prompt\[ \]*$" {
>  	    if ![string match "" $message] then {
> -		fail "$message"
> +		fail "$message (unexpected output)"
>  	    }
>  	    set result 1
>  	}

Looks good to me, more details do not hurt.  If it wasn't clear for you, 
it probably wasn't for some other people too.
  
Pedro Alves Nov. 23, 2016, 1:03 p.m. UTC | #2
On 09/12/2016 09:27 PM, Marc-Andre Laperle wrote:
> When using mi_gdb_test, if it fails because of the presence of
> unexpected output, the error message is only the message passed as
> the argument with no indication that there was an unexpected output.
> This change adds an additional text to the failure message to
> indicate that there was an unexpected output.
> 
> gdb/testsuite/ChangeLog:
> 
>         * lib/mi-support.exp (mi_gdb_test): Add additional message
>         for unexpected output.
> 
> Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>

OK.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 7c2bb3e..25995cf 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -824,7 +824,7 @@  proc mi_gdb_test { args } {
 	}
 	 -re ".*$mi_gdb_prompt\[ \]*$" {
 	    if ![string match "" $message] then {
-		fail "$message"
+		fail "$message (unexpected output)"
 	    }
 	    set result 1
 	}