Skip to content

Commit

Permalink
internal/gocore: let android builders skip tests calling loadExampleV…
Browse files Browse the repository at this point in the history
…ersion

loadExampleVersion copies and reads example core files, which may be bigger
than what android devices used in builders can handle.

Also, mark helper functions with t.Helper.

Fixes golang/go#34210

Change-Id: I73083cf0e59d928bb84cc1eb9b5b5a80a2e30f31
Reviewed-on: https://go-review.googlesource.com/c/debug/+/197777
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
  • Loading branch information
hyangah committed Sep 27, 2019
1 parent f175ee5 commit b644445
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/gocore/gocore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
// _ = *(*int)(nil)
// }
func loadExample(t *testing.T) *Process {
t.Helper()
if runtime.GOOS == "android" {
t.Skip("skipping test on android")
}
Expand All @@ -44,6 +45,10 @@ func loadExample(t *testing.T) *Process {
}

func loadExampleVersion(t *testing.T, version string) *Process {
t.Helper()
if runtime.GOOS == "android" {
t.Skip("skipping test on android")
}
if version == "1.9" {
version = ""
}
Expand Down Expand Up @@ -79,6 +84,7 @@ func loadExampleVersion(t *testing.T, version string) *Process {

// unzip unpacks the zip file name into the directory dir.
func unzip(t *testing.T, name, dir string) {
t.Helper()
r, err := zip.OpenReader(name)
if err != nil {
t.Fatalf("can't read zip file %s: %s", name, err)
Expand Down

0 comments on commit b644445

Please sign in to comment.