Commit e2662835 authored by Shenghou Ma's avatar Shenghou Ma

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
parent 3a3c5aad
...@@ -51,6 +51,7 @@ main(void) ...@@ -51,6 +51,7 @@ main(void)
int i, j, k, l; int i, j, k, l;
double complex n, d, q; double complex n, d, q;
printf("// skip\n");
printf("// # generated by cmplxdivide.c\n"); printf("// # generated by cmplxdivide.c\n");
printf("\n"); printf("\n");
printf("package main\n"); printf("package main\n");
......
// skip
// # generated by cmplxdivide.c // # generated by cmplxdivide.c
package main package main
......
// true // skip
// Copyright 2010 The Go Authors. All rights reserved. // Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// (! $G $D/$F.go) | grep 'initialization loop' >/dev/null || echo BUG: bug223 // errorcheck
// Copyright 2009 The Go Authors. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
...@@ -18,4 +18,4 @@ func f() { ...@@ -18,4 +18,4 @@ func f() {
} }
} }
var m = map[string]F{"f": f} var m = map[string]F{"f": f} // ERROR "initialization loop"
// true # used by import3 // skip # used by import3
// Copyright 2010 The Go Authors. All rights reserved. // Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// true # used by embed1.go // skip # used by embed1.go
// Copyright 2009 The Go Authors. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// true # used by private.go // skip # used by private.go
// Copyright 2011 The Go Authors. All rights reserved. // Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// true # used by recursive2 // skip # used by recursive2
// Copyright 2012 The Go Authors. All rights reserved. // Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// true // skip
// Copyright 2012 The Go Authors. All rights reserved. // Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// #ignore // skip
// Copyright 2012 The Go Authors. All rights reserved. // Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
...@@ -172,7 +172,7 @@ type test struct { ...@@ -172,7 +172,7 @@ type test struct {
donec chan bool // closed when done donec chan bool // closed when done
src string src string
action string // "compile", "build", "run", "errorcheck" action string // "compile", "build", "run", "errorcheck", "skip"
tempDir string tempDir string
err error err error
...@@ -253,6 +253,9 @@ func (t *test) run() { ...@@ -253,6 +253,9 @@ func (t *test) run() {
fallthrough fallthrough
case "compile", "build", "run", "errorcheck": case "compile", "build", "run", "errorcheck":
t.action = action t.action = action
case "skip":
t.action = "skip"
return
default: default:
t.err = skipError("skipped; unknown pattern: " + action) t.err = skipError("skipped; unknown pattern: " + action)
t.action = "??" t.action = "??"
......
...@@ -38,3 +38,7 @@ cmpout() { ...@@ -38,3 +38,7 @@ cmpout() {
errorcheck() { errorcheck() {
errchk $G -e $D/$F.go errchk $G -e $D/$F.go
} }
skip() {
true
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment