public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Go patch committed: Fix up a few test cases
@ 2011-09-24  9:41 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2011-09-24  9:41 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

I missed the fact that some of the updated Go tests were getting Tcl
errors leading to an unresolved state, rather than actually failing.
The errors were because the regular expressions which appear in the file
need to be translated into expressions which can be used with dg-error,
which is mainly a matter of appropriate Tcl quoting.  Of course the
regexps used to do quoting must themselves be quoted correctly, so the
results are rather arcane.  This patch updates the quoting so the tests
are actually tested, and updates the regexps to match the output of
gccgo.  Ran Go testsuite on x86_64-unknown-linux-gnu.  Committed to
mainline.

Ian


2011-09-23  Ian Lance Taylor  <iant@google.com>

	* go.test/go-test.exp (errchk): Handle more cases of getting
	correct Tcl backslash quoting in regular expressions in test file.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 3179 bytes --]

Index: test/fixedbugs/bug340.go
===================================================================
--- test/fixedbugs/bug340.go	(revision 179063)
+++ test/fixedbugs/bug340.go	(working copy)
@@ -10,8 +10,8 @@ package main
 
 func main() {
 	var x interface{}
-	switch t := x.(type) { // ERROR "0 is not a type"
-	case 0:
-		t.x = 1 // ERROR "type interface \{ \}"
+	switch t := x.(type) { // GC_ERROR "0 is not a type"
+	case 0:		// GCCGO_ERROR "expected type"
+		t.x = 1 // ERROR "type interface \{ \}|reference to undefined field or method"
 	}
 }
Index: test/fixedbugs/bug350.go
===================================================================
--- test/fixedbugs/bug350.go	(revision 179063)
+++ test/fixedbugs/bug350.go	(working copy)
@@ -8,8 +8,8 @@ package main
 
 type T int
 
-func (T) m() {}
-func (T) m() {} // ERROR "T[.]m redeclared"
+func (T) m() {} // GCCGO_ERROR "previous"
+func (T) m() {} // ERROR "T[.]m redeclared|redefinition"
 
-func (*T) p() {}
-func (*T) p() {} // ERROR "[(][*]T[)][.]p redeclared"
+func (*T) p() {} // GCCGO_ERROR "previous"
+func (*T) p() {} // ERROR "[(][*]T[)][.]p redeclared|redefinition"
Index: test/fixedbugs/bug351.go
===================================================================
--- test/fixedbugs/bug351.go	(revision 179063)
+++ test/fixedbugs/bug351.go	(working copy)
@@ -9,5 +9,5 @@ package main
 var x int
 
 func main() {
-	(x) := 0  // ERROR "non-name [(]x[)]"
+	(x) := 0  // ERROR "non-name [(]x[)]|non-name on left side"
 }
Index: go-test.exp
===================================================================
--- go-test.exp	(revision 179063)
+++ go-test.exp	(working copy)
@@ -61,13 +61,17 @@ proc errchk { test opts } {
 	    # experimentation, not analysis.
 	    regsub -all "\\.\\*" $out_line "\\\\\[ -~\\\\\]*" out_line
 	}
+	if [string match "*dg-error*\\\[?\\\]*" $out_line] {
+	    set index [string first "dg-error" $out_line]
+	    regsub -all "\\\[\(.\)\\\]" $out_line "\\\\\[\\1\\\\\]" out_line
+	}
 	if [string match "*dg-error*\{*" $out_line] {
 	    set index [string first "dg-error" $out_line]
-	    regsub -start $index -all "\{" $out_line "\\\\\[\\\{\\\\\]" out_line
+	    regsub -start $index -all "\(\[^\\\\]\)\{" $out_line "\\1\\\\\[\\\{\\\\\]" out_line
 	}
 	if [string match "*dg-error*\}*\}" $out_line] {
 	    set index [string first "dg-error" $out_line]
-	    regsub -start $index -all "\}\(.\)" $out_line "\\\\\[\\\}\\\\\]\\1" out_line
+	    regsub -start $index -all "\(\[^\\\\]\)\}\(.\)" $out_line "\\1\\\\\[\\\}\\\\\]\\2" out_line
 	}
 	if [string match "*dg-error*\(*" $out_line] {
 	    set index [string first "dg-error" $out_line]
@@ -77,10 +81,6 @@ proc errchk { test opts } {
 	    set index [string first "dg-error" $out_line]
 	    regsub -start $index -all "\\\\\\\)\(.\)" $out_line "\\\\\[\\\)\\\\\]\\1" out_line
 	}
-	if [string match "*dg-error*\[.\]*" $out_line] {
-	    set index [string first "dg-error" $out_line]
-	    regsub -all "\\\[\\.\\\]" $out_line "\\\\\[.\\\\\]" out_line
-	}
 	# Special case for bug332, in which the error message wants to
 	# match the file name, which is not what dg-error expects.
 	if [string match "*dg-error*bug332*" $out_line] {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-23 23:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-24  9:41 Go patch committed: Fix up a few test cases Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).