1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:04:44 -07:00

cmd/cover: fix build

Fix the various builds which don't have a real filesystem or don't support forking.

Change-Id: I3075c662fe6191ecbe70ba359b73d9a88bb06f35
Reviewed-on: https://go-review.googlesource.com/9528
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
This commit is contained in:
Dave Cheney 2015-05-01 12:38:11 +10:00
parent bc1410a4f9
commit ffd334493c

View File

@ -11,6 +11,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"testing"
)
@ -40,6 +41,15 @@ var debug = false // Keeps the rewritten files around if set.
// go run ./testdata/main.go ./testdata/test.go
//
func TestCover(t *testing.T) {
switch runtime.GOOS {
case "nacl":
t.Skipf("skipping; %v/%v no support for forking", runtime.GOOS, runtime.GOARCH)
case "darwin", "android":
switch runtime.GOARCH {
case "arm", "arm64":
t.Skipf("skipping; %v/%v no support for forking", runtime.GOOS, runtime.GOARCH)
}
}
// Read in the test file (testTest) and write it, with LINEs specified, to coverInput.
file, err := ioutil.ReadFile(testTest)
if err != nil {