Commit ebcc7ec1 authored by David Crawshaw's avatar David Crawshaw

cmd/dist: use -tags=lldb for iOS tests

As of golang.org/cl/9154, running go test will override a previous
go install -a -tags=lldb std with the tag-less version of stdlib. So
we pass -tags=lldb into the relevant go test commands.

Change-Id: I1c718289d7212373a9383eff53a643f06598f5ed
Reviewed-on: https://go-review.googlesource.com/10701Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
parent d751be9f
...@@ -215,6 +215,13 @@ func (t *tester) shouldRunTest(name string) bool { ...@@ -215,6 +215,13 @@ func (t *tester) shouldRunTest(name string) bool {
return false return false
} }
func (t *tester) tags() string {
if t.iOS() {
return "-tags=lldb"
}
return "-tags="
}
func (t *tester) timeout(sec int) string { func (t *tester) timeout(sec int) string {
return "-timeout=" + fmt.Sprint(time.Duration(sec)*time.Second*time.Duration(t.timeoutScale)) return "-timeout=" + fmt.Sprint(time.Duration(sec)*time.Second*time.Duration(t.timeoutScale))
} }
...@@ -243,6 +250,7 @@ func (t *tester) registerStdTest(pkg string) { ...@@ -243,6 +250,7 @@ func (t *tester) registerStdTest(pkg string) {
cmd := exec.Command("go", append([]string{ cmd := exec.Command("go", append([]string{
"test", "test",
"-short", "-short",
t.tags(),
t.timeout(120), t.timeout(120),
"-gcflags=" + os.Getenv("GO_GCFLAGS"), "-gcflags=" + os.Getenv("GO_GCFLAGS"),
}, stdMatches...)...) }, stdMatches...)...)
...@@ -281,7 +289,7 @@ func (t *tester) registerTests() { ...@@ -281,7 +289,7 @@ func (t *tester) registerTests() {
name: testName, name: testName,
heading: "GOMAXPROCS=2 runtime -cpu=1,2,4", heading: "GOMAXPROCS=2 runtime -cpu=1,2,4",
fn: func() error { fn: func() error {
cmd := t.dirCmd("src", "go", "test", "-short", t.timeout(300), "runtime", "-cpu=1,2,4") cmd := t.dirCmd("src", "go", "test", "-short", t.timeout(300), t.tags(), "runtime", "-cpu=1,2,4")
// We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code, // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
// creation of first goroutines and first garbage collections in the parallel setting. // creation of first goroutines and first garbage collections in the parallel setting.
cmd.Env = mergeEnvLists([]string{"GOMAXPROCS=2"}, os.Environ()) cmd.Env = mergeEnvLists([]string{"GOMAXPROCS=2"}, os.Environ())
...@@ -294,7 +302,7 @@ func (t *tester) registerTests() { ...@@ -294,7 +302,7 @@ func (t *tester) registerTests() {
name: "sync_cpu", name: "sync_cpu",
heading: "sync -cpu=10", heading: "sync -cpu=10",
fn: func() error { fn: func() error {
return t.dirCmd("src", "go", "test", "sync", "-short", t.timeout(120), "-cpu=10").Run() return t.dirCmd("src", "go", "test", "sync", "-short", t.timeout(120), t.tags(), "-cpu=10").Run()
}, },
}) })
...@@ -511,12 +519,12 @@ func (t *tester) cgoTest() error { ...@@ -511,12 +519,12 @@ func (t *tester) cgoTest() error {
env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ()) env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ())
if t.goos == "android" || t.iOS() { if t.goos == "android" || t.iOS() {
cmd := t.dirCmd("misc/cgo/test", "go", "test") cmd := t.dirCmd("misc/cgo/test", "go", "test", t.tags())
cmd.Env = env cmd.Env = env
return cmd.Run() return cmd.Run()
} }
cmd := t.dirCmd("misc/cgo/test", "go", "test", "-ldflags", "-linkmode=auto") cmd := t.dirCmd("misc/cgo/test", "go", "test", t.tags(), "-ldflags", "-linkmode=auto")
cmd.Env = env cmd.Env = env
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {
return err return err
......
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