]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/vet: skip exec tests on systems that can't exec
authorRuss Cox <rsc@golang.org>
Fri, 5 Jun 2015 14:34:17 +0000 (10:34 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 5 Jun 2015 14:35:13 +0000 (14:35 +0000)
Change-Id: I09257b8f5482cba10b5f4d3813c778d6e9e74d40
Reviewed-on: https://go-review.googlesource.com/10752
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/vet/vet_test.go

index 0027a1f3291f31199a1e7ad9cd3980a3d479e3b2..6c954638aba8724497d3c046bc557de527238217 100644 (file)
@@ -10,6 +10,7 @@ import (
        "os/exec"
        "path/filepath"
        "runtime"
+       "strings"
        "testing"
 )
 
@@ -24,10 +25,16 @@ const (
 //     rm testvet
 //
 func TestVet(t *testing.T) {
-       // Plan 9 and Windows systems can't be guaranteed to have Perl and so can't run errchk.
        switch runtime.GOOS {
        case "plan9", "windows":
+               // Plan 9 and Windows systems can't be guaranteed to have Perl and so can't run errchk.
                t.Skip("skipping test; no Perl on %q", runtime.GOOS)
+       case "nacl":
+               t.Skip("skipping test; no command execution on nacl")
+       case "darwin":
+               if strings.HasPrefix(runtime.GOARCH, "arm") {
+                       t.Skip("skipping test; no command execution on darwin/%s", runtime.GOARCH)
+               }
        }
 
        // go build
@@ -75,6 +82,15 @@ func run(c *exec.Cmd, t *testing.T) bool {
 
 // TestTags verifies that the -tags argument controls which files to check.
 func TestTags(t *testing.T) {
+       switch runtime.GOOS {
+       case "nacl":
+               t.Skip("skipping test; no command execution on nacl")
+       case "darwin":
+               if strings.HasPrefix(runtime.GOARCH, "arm") {
+                       t.Skip("skipping test; no command execution on darwin/%s", runtime.GOARCH)
+               }
+       }
+
        // go build
        cmd := exec.Command("go", "build", "-o", binary)
        run(cmd, t)