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

[dev.link] cmd/link: run more tests in parallel

Change-Id: I4062fd89f234b4ca5386b74584e1363c05e82e84
Reviewed-on: https://go-review.googlesource.com/c/go/+/241177
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Cherry Zhang 2020-07-06 17:49:24 -04:00
parent 130ede0d9e
commit 041d8850a1
5 changed files with 31 additions and 0 deletions

View File

@ -28,6 +28,8 @@ func testDWARF(t *testing.T, buildmode string, expectDWARF bool, env ...string)
t.Skip("skipping on plan9; no DWARF symbol table in executables") t.Skip("skipping on plan9; no DWARF symbol table in executables")
} }
t.Parallel()
out, err := exec.Command(testenv.GoToolPath(t), "list", "-f", "{{.Stale}}", "cmd/link").CombinedOutput() out, err := exec.Command(testenv.GoToolPath(t), "list", "-f", "{{.Stale}}", "cmd/link").CombinedOutput()
if err != nil { if err != nil {
t.Fatalf("go list: %v\n%s", err, out) t.Fatalf("go list: %v\n%s", err, out)

View File

@ -230,6 +230,8 @@ func TestPIESize(t *testing.T) {
t.Skip("-buildmode=pie not supported") t.Skip("-buildmode=pie not supported")
} }
t.Parallel()
tmpl := template.Must(template.New("pie").Parse(pieSourceTemplate)) tmpl := template.Must(template.New("pie").Parse(pieSourceTemplate))
writeGo := func(t *testing.T, dir string) { writeGo := func(t *testing.T, dir string) {

View File

@ -1376,6 +1376,8 @@ func TestIssue38192(t *testing.T) {
t.Skip("skipping on plan9; no DWARF symbol table in executables") t.Skip("skipping on plan9; no DWARF symbol table in executables")
} }
t.Parallel()
// Build a test program that contains a translation unit whose // Build a test program that contains a translation unit whose
// text (from am assembly source) contains only a single instruction. // text (from am assembly source) contains only a single instruction.
tmpdir, err := ioutil.TempDir("", "TestIssue38192") tmpdir, err := ioutil.TempDir("", "TestIssue38192")
@ -1487,6 +1489,8 @@ func TestIssue39757(t *testing.T) {
t.Skip("skipping on plan9; no DWARF symbol table in executables") t.Skip("skipping on plan9; no DWARF symbol table in executables")
} }
t.Parallel()
// In this bug the DWARF line table contents for the last couple of // In this bug the DWARF line table contents for the last couple of
// instructions in a function were incorrect (bad file/line). This // instructions in a function were incorrect (bad file/line). This
// test verifies that all of the line table rows for a function // test verifies that all of the line table rows for a function

View File

@ -29,6 +29,7 @@ func TestIssue33808(t *testing.T) {
} }
testenv.MustHaveGoBuild(t) testenv.MustHaveGoBuild(t)
testenv.MustHaveCGO(t) testenv.MustHaveCGO(t)
t.Parallel()
dir, err := ioutil.TempDir("", "TestIssue33808") dir, err := ioutil.TempDir("", "TestIssue33808")
if err != nil { if err != nil {

View File

@ -119,6 +119,8 @@ func TestIssue28429(t *testing.T) {
func TestUnresolved(t *testing.T) { func TestUnresolved(t *testing.T) {
testenv.MustHaveGoBuild(t) testenv.MustHaveGoBuild(t)
t.Parallel()
tmpdir, err := ioutil.TempDir("", "unresolved-") tmpdir, err := ioutil.TempDir("", "unresolved-")
if err != nil { if err != nil {
t.Fatalf("failed to create temp dir: %v", err) t.Fatalf("failed to create temp dir: %v", err)
@ -185,6 +187,8 @@ func TestIssue33979(t *testing.T) {
t.Skipf("Skipping on %s/%s", runtime.GOOS, runtime.GOARCH) t.Skipf("Skipping on %s/%s", runtime.GOOS, runtime.GOARCH)
} }
t.Parallel()
tmpdir, err := ioutil.TempDir("", "unresolved-") tmpdir, err := ioutil.TempDir("", "unresolved-")
if err != nil { if err != nil {
t.Fatalf("failed to create temp dir: %v", err) t.Fatalf("failed to create temp dir: %v", err)
@ -274,6 +278,8 @@ func TestBuildForTvOS(t *testing.T) {
t.Skipf("error running xcrun, required for iOS cross build: %v", err) t.Skipf("error running xcrun, required for iOS cross build: %v", err)
} }
t.Parallel()
sdkPath, err := exec.Command("xcrun", "--sdk", "appletvos", "--show-sdk-path").Output() sdkPath, err := exec.Command("xcrun", "--sdk", "appletvos", "--show-sdk-path").Output()
if err != nil { if err != nil {
t.Skip("failed to locate appletvos SDK, skipping") t.Skip("failed to locate appletvos SDK, skipping")
@ -324,6 +330,8 @@ func main() { println(X) }
func TestXFlag(t *testing.T) { func TestXFlag(t *testing.T) {
testenv.MustHaveGoBuild(t) testenv.MustHaveGoBuild(t)
t.Parallel()
tmpdir, err := ioutil.TempDir("", "TestXFlag") tmpdir, err := ioutil.TempDir("", "TestXFlag")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -350,6 +358,8 @@ func main() { }
func TestMacOSVersion(t *testing.T) { func TestMacOSVersion(t *testing.T) {
testenv.MustHaveGoBuild(t) testenv.MustHaveGoBuild(t)
t.Parallel()
tmpdir, err := ioutil.TempDir("", "TestMacOSVersion") tmpdir, err := ioutil.TempDir("", "TestMacOSVersion")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -427,6 +437,8 @@ func TestIssue34788Android386TLSSequence(t *testing.T) {
t.Skip("skipping on non-{linux,darwin}/amd64 platform") t.Skip("skipping on non-{linux,darwin}/amd64 platform")
} }
t.Parallel()
tmpdir, err := ioutil.TempDir("", "TestIssue34788Android386TLSSequence") tmpdir, err := ioutil.TempDir("", "TestIssue34788Android386TLSSequence")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -487,6 +499,8 @@ func TestStrictDup(t *testing.T) {
// Check that -strictdups flag works. // Check that -strictdups flag works.
testenv.MustHaveGoBuild(t) testenv.MustHaveGoBuild(t)
t.Parallel()
tmpdir, err := ioutil.TempDir("", "TestStrictDup") tmpdir, err := ioutil.TempDir("", "TestStrictDup")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -571,6 +585,8 @@ func TestFuncAlign(t *testing.T) {
} }
testenv.MustHaveGoBuild(t) testenv.MustHaveGoBuild(t)
t.Parallel()
tmpdir, err := ioutil.TempDir("", "TestFuncAlign") tmpdir, err := ioutil.TempDir("", "TestFuncAlign")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -637,6 +653,8 @@ func TestTrampoline(t *testing.T) {
testenv.MustHaveGoBuild(t) testenv.MustHaveGoBuild(t)
t.Parallel()
tmpdir, err := ioutil.TempDir("", "TestTrampoline") tmpdir, err := ioutil.TempDir("", "TestTrampoline")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -671,6 +689,8 @@ func TestIndexMismatch(t *testing.T) {
// manually, and try to "trick" the linker with an inconsistent object file. // manually, and try to "trick" the linker with an inconsistent object file.
testenv.MustHaveGoBuild(t) testenv.MustHaveGoBuild(t)
t.Parallel()
tmpdir, err := ioutil.TempDir("", "TestIndexMismatch") tmpdir, err := ioutil.TempDir("", "TestIndexMismatch")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -731,6 +751,8 @@ func TestPErsrc(t *testing.T) {
t.Skipf("this is a windows/amd64-only test") t.Skipf("this is a windows/amd64-only test")
} }
t.Parallel()
tmpdir, err := ioutil.TempDir("", "TestPErsrc") tmpdir, err := ioutil.TempDir("", "TestPErsrc")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)