go/packages: only test TestSizes on GOOS where 386 and amd64 GOARCH exists

Fixes solaris/amd64 about missing solaris/386, which isn't a supported port:

https://build.golang.org/log/39bfb29694089b7aaa6d0a60cc9bd3360129c2ab

Change-Id: If6d9fb368f3236ccf461d5ec47ad3ff4b7ef55b6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/170619
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
Brad Fitzpatrick 2019-04-03 17:40:56 +00:00
parent 1aadbdfdbb
commit 8a44e74612
1 changed files with 7 additions and 0 deletions

View File

@ -1169,6 +1169,13 @@ func testContainsOverlay(t *testing.T, exporter packagestest.Exporter) {
// too report the correct sizes function for the actual configuration. // too report the correct sizes function for the actual configuration.
func TestSizes(t *testing.T) { packagestest.TestAll(t, testSizes) } func TestSizes(t *testing.T) { packagestest.TestAll(t, testSizes) }
func testSizes(t *testing.T, exporter packagestest.Exporter) { func testSizes(t *testing.T, exporter packagestest.Exporter) {
// Only run this test on operating systems that have both an amd64 and 386 port.
switch runtime.GOOS {
case "darwin", "linux", "windows", "freebsd", "openbsd", "android":
default:
t.Skipf("skipping test on %s", runtime.GOOS)
}
exported := packagestest.Export(t, exporter, []packagestest.Module{{ exported := packagestest.Export(t, exporter, []packagestest.Module{{
Name: "golang.org/fake", Name: "golang.org/fake",
Files: map[string]interface{}{ Files: map[string]interface{}{