aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-03-22 02:14:44 +0800
committerShenghou Ma <minux.ma@gmail.com>2012-03-22 02:14:44 +0800
commite2662835b8dd3ca4aa69997afe3774467a677df8 (patch)
tree06bf3d5b879d6031e1ef6639388320eb42601557
parent3a3c5aad4e6ccef38a1e6d56652523c3258da6a8 (diff)
downloadgo-e2662835b8dd3ca4aa69997afe3774467a677df8.tar.gz
go-e2662835b8dd3ca4aa69997afe3774467a677df8.zip
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
-rw-r--r--test/cmplxdivide.c1
-rw-r--r--test/cmplxdivide1.go1
-rw-r--r--test/ddd2.go2
-rw-r--r--test/fixedbugs/bug223.go4
-rw-r--r--test/import2.go2
-rw-r--r--test/interface/embed0.go2
-rw-r--r--test/interface/private1.go2
-rw-r--r--test/interface/recursive1.go2
-rw-r--r--test/method4a.go2
-rw-r--r--test/run.go7
-rw-r--r--test/testlib4
11 files changed, 19 insertions, 10 deletions
diff --git a/test/cmplxdivide.c b/test/cmplxdivide.c
index b340f04d88..12dc4f1c0c 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 6a1dee9fe7..e9031dd151 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 2edae36b1e..a141a39c76 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 80f9cae819..eccf574a14 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 0acfabcc18..5c275f34b3 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 dee8319e4e..e2ee20adeb 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 9c831a2f47..3281c38be6 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 524dda82c6..cc3cdc37f1 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 11fa218f3d..d23039bfaa 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 bf79079b64..ac6e3c0e27 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 4c7d9578b5..3858431a7e 100644
--- a/test/testlib
+++ b/test/testlib
@@ -38,3 +38,7 @@ cmpout() {
errorcheck() {
errchk $G -e $D/$F.go
}
+
+skip() {
+ true
+}