Patchwork [testsuite] scandump.exp: use printable version of regexp

login
register
mail settings
Submitter Janis Johnson
Date June 13, 2012, 9:13 p.m.
Message ID <4FD9027F.90005@mentor.com>
Download mbox | patch
Permalink /patch/164764/
State New
Headers show

Comments

Janis Johnson - June 13, 2012, 9:13 p.m.
Most scan-* procedures used in dg-final test directives use a printable
version of the regular expression in the test summary.  This patch makes
scan-*-dump-tiles do that as well, which eliminates several duplicates
in test summaries for expressions that contain a newline.

Tested on i686-pc-linux-gnu and arm-none-eabi.  OK for mainline?

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

	* lib/scandump.exp (scan-dump-times): Use printable version of
	regexp in test summary line.
Mike Stump - June 13, 2012, 10:11 p.m.
On Jun 13, 2012, at 2:13 PM, Janis Johnson wrote:
> Most scan-* procedures used in dg-final test directives use a printable
> version of the regular expression in the test summary.  This patch makes
> scan-*-dump-tiles do that as well, which eliminates several duplicates
> in test summaries for expressions that contain a newline.

Ok.

Patch

Index: lib/scandump.exp
===================================================================
--- lib/scandump.exp	(revision 188482)
+++ lib/scandump.exp	(working copy)
@@ -94,7 +94,8 @@ 
     upvar 3 name testcase
 
     set suf [dump-suffix [lindex $args 3]]
-    set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"[lindex $args 1]\" [lindex $args 2]"
+    set printable_pattern [make_pattern_printable [lindex $args 1]]
+    set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]"
     set src [file tail [lindex $testcase 0]]
     set output_file "[glob -nocomplain $src.[lindex $args 3]]"
     if { $output_file == "" } {