From d4aed7e42cd187c3031350489dba814f29f215a5 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Thu, 30 Sep 2021 12:02:56 -0400 Subject: [PATCH] debug/gosym: run TestPCLine on Linux/AMD64 in short mode Currently TestPCLine is skipped in short mode. The test builds a Linux/AMD64 binary, so it makes sense to skip it if we're cross compiling, as building the runtime takes a while. But if we are on Linux/AMD64, it will only build a small amount of code, which isn't really slow. The test runs in 0.14 second on my machine. I think it is acceptable to run in short mode. Then we'll have trybot coverage for this test. Change-Id: If682f88c28050f7daafde35b4f9e59c03b764a35 Reviewed-on: https://go-review.googlesource.com/c/go/+/353330 Trust: Cherry Mui Trust: Josh Bleecher Snyder Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Josh Bleecher Snyder --- src/debug/gosym/pclntab_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/debug/gosym/pclntab_test.go b/src/debug/gosym/pclntab_test.go index 8589227157..d690a1e3f2 100644 --- a/src/debug/gosym/pclntab_test.go +++ b/src/debug/gosym/pclntab_test.go @@ -29,6 +29,10 @@ func dotest(t *testing.T) { if runtime.GOARCH != "amd64" { t.Skipf("skipping on non-AMD64 system %s", runtime.GOARCH) } + // This test builds a Linux/AMD64 binary. Skipping in short mode if cross compiling. + if runtime.GOOS != "linux" && testing.Short() { + t.Skipf("skipping in short mode on non-Linux system %s", runtime.GOARCH) + } var err error pclineTempDir, err = os.MkdirTemp("", "pclinetest") if err != nil { @@ -198,9 +202,6 @@ func TestLineAline(t *testing.T) { } func TestPCLine(t *testing.T) { - if testing.Short() { - t.Skip("skipping in -short mode") - } dotest(t) defer endtest() -- 2.48.1