Patchwork [testsuite] scandump.exp: use printable pattern in test summary

login
register
mail settings
Submitter Janis Johnson
Date June 26, 2012, 6:29 p.m.
Message ID <4FE9FF98.8000000@mentor.com>
Download mbox | patch
Permalink /patch/167435/
State New
Headers show

Comments

Janis Johnson - June 26, 2012, 6:29 p.m.
Procedure scan-dump-times in scandump.exp uses a printable version of
the scanned pattern in the line reported to the test summary but others
in that file don't.  This patch fixes that in the remaining procedures
in scandump.exp.  The primary advantage of using the printable pattern
is with patterns that include newlines, to keep the pattern all on the
same line in the test summary.

Tested on i686-pc-linux-gnu for gcc and g++.  OK for trunk?

Janis
2012-06-26  Janis Johnson  <janisjo@codesourcery.com>

	* lib/scandump.exp (scan-dump, scan-dump-not, scan-dump-dem,
	scan-dump-dem-not): Use printable pattern in test name.
Mike Stump - June 26, 2012, 8:11 p.m.
On Jun 26, 2012, at 11:29 AM, Janis Johnson wrote:
> Procedure scan-dump-times in scandump.exp uses a printable version of
> the scanned pattern in the line reported to the test summary but others
> in that file don't.

> OK for trunk?

Ok.

Patch

Index: lib/scandump.exp
===================================================================
--- lib/scandump.exp	(revision 188974)
+++ lib/scandump.exp	(working copy)
@@ -47,8 +47,9 @@ 
 
     set testcase [testname-for-summary]
 
+    set printable_pattern [make_pattern_printable [lindex $args 1]]
     set suf [dump-suffix [lindex $args 2]]
-    set testname "$testcase scan-[lindex $args 0]-dump $suf \"[lindex $args 1]\""
+    set testname "$testcase scan-[lindex $args 0]-dump $suf \"$printable_pattern\""
     set src [file tail [lindex $testcase 0]]
     set output_file "[glob -nocomplain $src.[lindex $args 2]]"
     if { $output_file == "" } {
@@ -126,8 +127,9 @@ 
     }
 
     set testcase [testname-for-summary]
+    set printable_pattern [make_pattern_printable [lindex $args 1]]
     set suf [dump-suffix [lindex $args 2]]
-    set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"[lindex $args 1]\""
+    set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"$printable_pattern\""
     set src [file tail [lindex $testcase 0]]
     set output_file "[glob -nocomplain $src.[lindex $args 2]]"
     if { $output_file == "" } {
@@ -178,8 +180,9 @@ 
     }
 
     set testcase [testname-for-summary]
+    set printable_pattern [make_pattern_printable [lindex $args 1]]
     set suf [dump-suffix [lindex $args 2]]
-    set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"[lindex $args 1]\""
+    set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"$printable_pattern\""
     set src [file tail [lindex $testcase 0]]
     set output_file "[glob -nocomplain $src.[lindex $args 2]]"
     if { $output_file == "" } {
@@ -229,8 +232,9 @@ 
     }
 
     set testcase [testname-for-summary]
+    set printable_pattern [make_pattern_printable [lindex $args 1]
     set suf [dump-suffix [lindex $args 2]]
-    set testname "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"[lindex $args 1]\""
+    set testname "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"$printable_pattern\""
     set src [file tail [lindex $testcase 0]]
     set output_file "[glob -nocomplain $src.[lindex $args 2]]"
     if { $output_file == "" } {