This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go testsuite patch committed: Combine strings in comments


The master Go testsuite uses lines like
	// ERROR "first error" "second error"
to match multiple errors on a second line.  This patch to the Go
testsuite driver supports that format.  It accepts any of the errors,
but does not require that all of them be present.  Ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian


2013-10-24  Ian Lance Taylor  <iant@google.com>

	* go.test/go-test.exp (errchk): Combine quoted strings in
	comments.


Index: go.test/go-test.exp
===================================================================
--- go.test/go-test.exp	(revision 203578)
+++ go.test/go-test.exp	(working copy)
@@ -90,6 +90,21 @@ proc errchk { test opts } {
 	    puts $fdout $copy_line
 	    continue
 	}
+
+	# Combine quoted strings in comments, so that
+	# // ERROR "first error" "second error"
+	# turns into
+	# // ERROR "first error|second error"
+	# This format is used by the master testsuite to recognize
+	# multiple errors on a single line.  We don't require that all
+	# the errors be present, but we do want to accept any of them.
+	set changed ""
+	while { $changed != $copy_line } {
+	    set changed $copy_line
+	    regsub "\(// \[^\"\]*\"\[^\"\]*\)\" \"" $copy_line "\\1|" out_line
+	    set copy_line $out_line
+	}
+
 	regsub "// \(GCCGO_\)?ERROR \"\(\[^\"\]*\)\".*$" $copy_line "// \{ dg-error \"\\2\" \}" out_line
 	if [string match "*dg-error*\\\[*" $out_line] {
 	    set index [string first "dg-error" $out_line]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]