From e2662835b8dd3ca4aa69997afe3774467a677df8 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Thu, 22 Mar 2012 02:14:44 +0800 Subject: [PATCH] test: use testlib in a few more cases Introduce a new skip cmd. R=golang-dev, bradfitz, iant, iant CC=golang-dev https://golang.org/cl/5868048 --- test/cmplxdivide.c | 1 + test/cmplxdivide1.go | 1 + test/ddd2.go | 2 +- test/fixedbugs/bug223.go | 4 ++-- test/import2.go | 2 +- test/interface/embed0.go | 2 +- test/interface/private1.go | 2 +- test/interface/recursive1.go | 2 +- test/method4a.go | 2 +- test/run.go | 7 +++++-- test/testlib | 4 ++++ 11 files changed, 19 insertions(+), 10 deletions(-) diff --git a/test/cmplxdivide.c b/test/cmplxdivide.c index b340f04d887..12dc4f1c0c9 100644 --- a/test/cmplxdivide.c +++ b/test/cmplxdivide.c @@ -51,6 +51,7 @@ main(void) int i, j, k, l; double complex n, d, q; + printf("// skip\n"); printf("// # generated by cmplxdivide.c\n"); printf("\n"); printf("package main\n"); diff --git a/test/cmplxdivide1.go b/test/cmplxdivide1.go index 6a1dee9fe78..e9031dd1514 100644 --- a/test/cmplxdivide1.go +++ b/test/cmplxdivide1.go @@ -1,3 +1,4 @@ +// skip // # generated by cmplxdivide.c package main diff --git a/test/ddd2.go b/test/ddd2.go index 2edae36b1ed..a141a39c766 100644 --- a/test/ddd2.go +++ b/test/ddd2.go @@ -1,4 +1,4 @@ -// true +// skip // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/fixedbugs/bug223.go b/test/fixedbugs/bug223.go index 80f9cae8199..eccf574a14c 100644 --- a/test/fixedbugs/bug223.go +++ b/test/fixedbugs/bug223.go @@ -1,4 +1,4 @@ -// (! $G $D/$F.go) | grep 'initialization loop' >/dev/null || echo BUG: bug223 +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -18,4 +18,4 @@ func f() { } } -var m = map[string]F{"f": f} +var m = map[string]F{"f": f} // ERROR "initialization loop" diff --git a/test/import2.go b/test/import2.go index 0acfabcc182..5c275f34b36 100644 --- a/test/import2.go +++ b/test/import2.go @@ -1,4 +1,4 @@ -// true # used by import3 +// skip # used by import3 // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/interface/embed0.go b/test/interface/embed0.go index dee8319e4e9..e2ee20adeba 100644 --- a/test/interface/embed0.go +++ b/test/interface/embed0.go @@ -1,4 +1,4 @@ -// true # used by embed1.go +// skip # used by embed1.go // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/interface/private1.go b/test/interface/private1.go index 9c831a2f477..3281c38be60 100644 --- a/test/interface/private1.go +++ b/test/interface/private1.go @@ -1,4 +1,4 @@ -// true # used by private.go +// skip # used by private.go // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/interface/recursive1.go b/test/interface/recursive1.go index 524dda82c6f..cc3cdc37f1a 100644 --- a/test/interface/recursive1.go +++ b/test/interface/recursive1.go @@ -1,4 +1,4 @@ -// true # used by recursive2 +// skip # used by recursive2 // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/method4a.go b/test/method4a.go index 11fa218f3d9..d23039bfaaa 100644 --- a/test/method4a.go +++ b/test/method4a.go @@ -1,4 +1,4 @@ -// true +// skip // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/run.go b/test/run.go index bf79079b647..ac6e3c0e276 100644 --- a/test/run.go +++ b/test/run.go @@ -1,4 +1,4 @@ -// #ignore +// skip // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -172,7 +172,7 @@ type test struct { donec chan bool // closed when done src string - action string // "compile", "build", "run", "errorcheck" + action string // "compile", "build", "run", "errorcheck", "skip" tempDir string err error @@ -253,6 +253,9 @@ func (t *test) run() { fallthrough case "compile", "build", "run", "errorcheck": t.action = action + case "skip": + t.action = "skip" + return default: t.err = skipError("skipped; unknown pattern: " + action) t.action = "??" diff --git a/test/testlib b/test/testlib index 4c7d9578b53..3858431a7e1 100644 --- a/test/testlib +++ b/test/testlib @@ -38,3 +38,7 @@ cmpout() { errorcheck() { errchk $G -e $D/$F.go } + +skip() { + true +}