]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: enable more tests on js/wasm
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 25 Jun 2018 19:05:25 +0000 (19:05 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 25 Jun 2018 20:01:45 +0000 (20:01 +0000)
Fixes #26050

Change-Id: I21697ac30eb3bc423263cba885bce5fea8f81d94
Reviewed-on: https://go-review.googlesource.com/120796
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
src/cmd/dist/test.go

index 6d449ec499d7b698d3edf34bf16a507ab8b6ffed..756f1ddd4e8326431edfdff94fc69baac4445fbe 100644 (file)
@@ -446,12 +446,12 @@ func (t *tester) registerTests() {
                })
        }
 
-       if t.race || goos == "js" {
+       if t.race {
                return
        }
 
        // Runtime CPU tests.
-       if !t.compileOnly {
+       if !t.compileOnly && goos != "js" { // js can't handle -cpu != 1
                testName := "runtime:cpu124"
                t.tests = append(t.tests, distTest{
                        name:    testName,
@@ -492,9 +492,9 @@ func (t *tester) registerTests() {
        // On the builders only, test that a moved GOROOT still works.
        // Fails on iOS because CC_FOR_TARGET refers to clangwrap.sh
        // in the unmoved GOROOT.
-       // Fails on Android with an exec format error.
+       // Fails on Android and js/wasm with an exec format error.
        // Fails on plan9 with "cannot find GOROOT" (issue #21016).
-       if os.Getenv("GO_BUILDER_NAME") != "" && goos != "android" && !t.iOS() && goos != "plan9" {
+       if os.Getenv("GO_BUILDER_NAME") != "" && goos != "android" && !t.iOS() && goos != "plan9" && goos != "js" {
                t.tests = append(t.tests, distTest{
                        name:    "moved_goroot",
                        heading: "moved GOROOT",
@@ -585,14 +585,16 @@ func (t *tester) registerTests() {
        }
 
        // sync tests
-       t.tests = append(t.tests, distTest{
-               name:    "sync_cpu",
-               heading: "sync -cpu=10",
-               fn: func(dt *distTest) error {
-                       t.addCmd(dt, "src", t.goTest(), "sync", t.timeout(120), "-cpu=10", t.runFlag(""))
-                       return nil
-               },
-       })
+       if goos != "js" { // js doesn't support -cpu=10
+               t.tests = append(t.tests, distTest{
+                       name:    "sync_cpu",
+                       heading: "sync -cpu=10",
+                       fn: func(dt *distTest) error {
+                               t.addCmd(dt, "src", t.goTest(), "sync", t.timeout(120), "-cpu=10", t.runFlag(""))
+                               return nil
+                       },
+               })
+       }
 
        if t.raceDetectorSupported() {
                t.tests = append(t.tests, distTest{
@@ -716,7 +718,7 @@ func (t *tester) registerTests() {
 
        // Doc tests only run on builders.
        // They find problems approximately never.
-       if t.hasBash() && goos != "nacl" && goos != "android" && !t.iOS() && os.Getenv("GO_BUILDER_NAME") != "" {
+       if t.hasBash() && goos != "nacl" && goos != "js" && goos != "android" && !t.iOS() && os.Getenv("GO_BUILDER_NAME") != "" {
                t.registerTest("doc_progs", "../doc/progs", "time", "go", "run", "run.go")
                t.registerTest("wiki", "../doc/articles/wiki", "./test.bash")
                t.registerTest("codewalk", "../doc/codewalk", "time", "./run")
@@ -742,7 +744,7 @@ func (t *tester) registerTests() {
                        })
                }
        }
-       if goos != "nacl" && goos != "android" && !t.iOS() {
+       if goos != "nacl" && goos != "android" && !t.iOS() && goos != "js" {
                t.tests = append(t.tests, distTest{
                        name:    "api",
                        heading: "API check",