Skip to content

Commit 44c4155

Browse files
committed
tests: Classify new Go 1.9 tests.
The fixedbugs/issue19182.go test requires GOMAXPROCS=2, otherwise it never terminates. Avoid running it, since GopherJS only supports GOMAXPROCS=1. The fixedbugs/issue19246.go case looks similar to #551. /cc @neelance Check knownFails table before potentially setting test.err to nil for skip errors. Otherwise the never-terminate skip tests get incorrectly classified as "unok" instead of "knfl".
1 parent d48065b commit 44c4155

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

tests/run.go

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,21 @@ var knownFails = map[string]failReason{
9090
"fixedbugs/issue15528.go": {category: usesUnsupportedPackage, desc: `imports "unsafe" package and gets: Error: reflect: call of reflect.Value.IsNil on unsafe.Pointer Value`}, // See https://github.com/golang/go/commit/dfc56a4cd313c9c5de37f4fadb14912286edc42f for relevant commit.
9191
"fixedbugs/issue17381.go": {category: unsureIfGopherJSSupportsThisFeature, desc: "tests runtime.{Callers,FuncForPC} behavior in a deferred func with garbage on stack... does GopherJS even support runtime.{Callers,FuncForPC}?"},
9292
"fixedbugs/issue18149.go": {desc: "//line directives with filenames are not correctly parsed, see https://github.com/gopherjs/gopherjs/issues/553."},
93+
94+
// These are new tests in Go 1.9.
95+
"fixedbugs/issue19182.go": {category: neverTerminates, desc: "needs GOMAXPROCS=2"},
96+
"fixedbugs/issue19040.go": {desc: `panicwrap error text:
97+
"runtime error: invalid memory address or nil pointer dereference"
98+
want:
99+
"value method main.T.F called using nil *T pointer"`},
100+
"fixedbugs/issue19246.go": {desc: "expected nil pointer dereference panic"}, // Issue https://golang.org/issues/19246: Failed to evaluate some zero-sized values when converting them to interfaces.
93101
}
94102

95103
type failCategory uint8
96104

97105
const (
98106
other failCategory = iota
107+
neverTerminates // Test never terminates (so avoid starting it).
99108
usesUnsupportedPackage // Test fails because it imports an unsupported package, e.g., "unsafe".
100109
requiresSourceMapSupport // Test fails without source map support (as configured in CI), because it tries to check filename/line number via runtime.Caller.
101110
compilerPanic
@@ -214,11 +223,6 @@ func main() {
214223
}
215224
status := "ok "
216225
errStr := ""
217-
if _, isSkip := test.err.(skipError); isSkip {
218-
test.err = nil
219-
errStr = "unexpected skip for " + path.Join(test.dir, test.gofile) + ": " + errStr
220-
status = "FAIL"
221-
}
222226
// GOPHERJS.
223227
if _, ok := knownFails[filepath.ToSlash(test.goFileName())]; ok && test.err != nil {
224228
errStr = test.err.Error()
@@ -229,6 +233,11 @@ func main() {
229233
// If this is not an accident, it should be removed from knownFails map.
230234
status = "unok"
231235
}
236+
if _, isSkip := test.err.(skipError); isSkip {
237+
test.err = nil
238+
errStr = "unexpected skip for " + path.Join(test.dir, test.gofile) + ": " + errStr
239+
status = "FAIL"
240+
}
232241
if test.err != nil {
233242
status = "FAIL"
234243
errStr = test.err.Error()
@@ -523,6 +532,12 @@ func (t *test) run() {
523532
close(t.donec)
524533
}()
525534

535+
// GOPHERJS: Some tests may never terminate once started. Avoid starting them.
536+
if kf, ok := knownFails[filepath.ToSlash(t.goFileName())]; ok && kf.category == neverTerminates {
537+
t.err = skipError("skipping because it doesn't terminate")
538+
return
539+
}
540+
526541
srcBytes, err := ioutil.ReadFile(t.goFileName())
527542
if err != nil {
528543
t.err = err

0 commit comments

Comments
 (0)