Patchwork Remove regexp and expected output from gtest pass/fail line

login
register
mail settings
Submitter Richard Sandiford
Date Dec. 8, 2013, 7:18 p.m.
Message ID <87k3ff8836.fsf@talisman.default>
Download mbox | patch
Permalink /patch/298857/
State New
Headers show

Comments

Richard Sandiford - Dec. 8, 2013, 7:18 p.m.
Jakub Jelinek <jakub@redhat.com> writes:
> On Sun, Dec 08, 2013 at 10:31:56AM +0000, Richard Sandiford wrote:
>> --- gcc/testsuite/lib/asan-dg.exp	(revision 205654)
>> +++ gcc/testsuite/lib/asan-dg.exp	(working copy)
>> @@ -288,9 +288,10 @@
>>  		    if { "$status" == "fail" } {
>>  			pass "$testname execution test"
>>  			if { ![regexp $regexpr ${output}] } {
>> -			    fail "$testname output pattern test, should match $regexpr"
>> +			    fail "$testname output pattern test"
>> +			    send_log "Output was:\n${output}\nShould match:\n$regexpr\n"
>
> Are you sure you need to print ${output}?  At least looking at current
> g++.log or gcc.log file, it looks like the program's output is already
> there, so it is IMHO undesriable to print it there once again.

OK, how about this version?

Thanks,
Richard


gcc/testsuite/
	* lib/asan-dg.exp (asan-gtest): Remove actual and expected output
	from the pass/fail line and add it to the log instead.
Jakub Jelinek - Dec. 8, 2013, 9:15 p.m.
On Sun, Dec 08, 2013 at 07:18:37PM +0000, Richard Sandiford wrote:
> gcc/testsuite/
> 	* lib/asan-dg.exp (asan-gtest): Remove actual and expected output
> 	from the pass/fail line and add it to the log instead.

Looks ok to me, except the ChangeLog, all I'm seeing is that you are
removing expected output from the pass/fail line, not the actual output.

> --- gcc/testsuite/lib/asan-dg.exp	2013-12-04 10:47:41.499044571 +0000
> +++ gcc/testsuite/lib/asan-dg.exp	2013-12-08 19:18:01.840876860 +0000
> @@ -288,9 +288,10 @@ proc asan-gtest { args } {
>  		    if { "$status" == "fail" } {
>  			pass "$testname execution test"
>  			if { ![regexp $regexpr ${output}] } {
> -			    fail "$testname output pattern test, should match $regexpr"
> +			    fail "$testname output pattern test"
> +			    send_log "Output should match: $regexpr\n"
>  			} else {
> -			    pass "$testname output pattern test, $regexpr"
> +			    pass "$testname output pattern test"
>  			}
>  		    } elseif { "$status" == "pass" } {
>  			fail "$testname execution test"

	Jakub

Patch

Index: gcc/testsuite/lib/asan-dg.exp
===================================================================
--- gcc/testsuite/lib/asan-dg.exp	2013-12-04 10:47:41.499044571 +0000
+++ gcc/testsuite/lib/asan-dg.exp	2013-12-08 19:18:01.840876860 +0000
@@ -288,9 +288,10 @@  proc asan-gtest { args } {
 		    if { "$status" == "fail" } {
 			pass "$testname execution test"
 			if { ![regexp $regexpr ${output}] } {
-			    fail "$testname output pattern test, should match $regexpr"
+			    fail "$testname output pattern test"
+			    send_log "Output should match: $regexpr\n"
 			} else {
-			    pass "$testname output pattern test, $regexpr"
+			    pass "$testname output pattern test"
 			}
 		    } elseif { "$status" == "pass" } {
 			fail "$testname execution test"