From ebcc7ec148f4c224a2b026b6484ad0fa135dcf78 Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Thu, 4 Jun 2015 15:03:38 -0400 Subject: [PATCH] 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/10701 Reviewed-by: Josh Bleecher Snyder Run-TryBot: Josh Bleecher Snyder --- src/cmd/dist/test.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 5c155deaa6..07be97547f 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -215,6 +215,13 @@ func (t *tester) shouldRunTest(name string) bool { return false } +func (t *tester) tags() string { + if t.iOS() { + return "-tags=lldb" + } + return "-tags=" +} + func (t *tester) timeout(sec int) string { return "-timeout=" + fmt.Sprint(time.Duration(sec)*time.Second*time.Duration(t.timeoutScale)) } @@ -243,6 +250,7 @@ func (t *tester) registerStdTest(pkg string) { cmd := exec.Command("go", append([]string{ "test", "-short", + t.tags(), t.timeout(120), "-gcflags=" + os.Getenv("GO_GCFLAGS"), }, stdMatches...)...) @@ -281,7 +289,7 @@ func (t *tester) registerTests() { name: testName, heading: "GOMAXPROCS=2 runtime -cpu=1,2,4", 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, // creation of first goroutines and first garbage collections in the parallel setting. cmd.Env = mergeEnvLists([]string{"GOMAXPROCS=2"}, os.Environ()) @@ -294,7 +302,7 @@ func (t *tester) registerTests() { name: "sync_cpu", heading: "sync -cpu=10", 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 { env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ()) 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 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 if err := cmd.Run(); err != nil { return err -- 2.50.0