]> Cypherpunks repositories - gostls13.git/commitdiff
debug/gosym: run TestPCLine on Linux/AMD64 in short mode
authorCherry Mui <cherryyz@google.com>
Thu, 30 Sep 2021 16:02:56 +0000 (12:02 -0400)
committerCherry Mui <cherryyz@google.com>
Thu, 30 Sep 2021 16:34:25 +0000 (16:34 +0000)
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 <cherryyz@google.com>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/debug/gosym/pclntab_test.go

index 8589227157d3e432c4b0e1dca078445beb6b322a..d690a1e3f2de21a61ede6087ceff17d7dbdbb56d 100644 (file)
@@ -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()