]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/pprof: fix build breakage on ios
authorCosmos Nicolaou <cosmos.nicolaou@gmail.com>
Wed, 9 Aug 2023 15:15:51 +0000 (08:15 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 10 Aug 2023 15:35:31 +0000 (15:35 +0000)
CL 503919 breaks tests for ios, this change fixes that.

Fixes #61891

Change-Id: I58508a780abb7a2150faec83c0f002cb22abafb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/517795
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>

src/runtime/pprof/proto_test.go
src/runtime/pprof/vminfo_darwin_test.go

index eb43816b7c92d34f79f244b82f4ceab03354497d..f788b167da3ea9b9588660d0a9167d73d6826935 100644 (file)
@@ -101,7 +101,7 @@ func testPCs(t *testing.T) (addr1, addr2 uint64, map1, map2 *profile.Mapping) {
                addr2 = mprof.Mapping[1].Start
                map2 = mprof.Mapping[1]
                map2.BuildID, _ = elfBuildID(map2.File)
-       case "windows", "darwin":
+       case "windows", "darwin", "ios":
                addr1 = uint64(abi.FuncPCABIInternal(f1))
                addr2 = uint64(abi.FuncPCABIInternal(f2))
 
index 3023878fdeea02ac14fbfb546b7da42f962b52e6..c476110b09f65361680680bd7ff5b62f4a98eb11 100644 (file)
@@ -2,14 +2,16 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !ios
+
 package pprof
 
 import (
        "bufio"
        "bytes"
        "internal/abi"
+       "internal/testenv"
        "os"
-       "os/exec"
        "strconv"
        "strings"
        "testing"
@@ -51,7 +53,8 @@ func TestVMInfo(t *testing.T) {
 
 func useVMMap(t *testing.T) (hi, lo uint64) {
        pid := strconv.Itoa(os.Getpid())
-       out, err := exec.Command("vmmap", pid).Output()
+       testenv.MustHaveExecPath(t, "vmmap")
+       out, err := testenv.Command(t, "vmmap", pid).Output()
        if err != nil {
                t.Fatal(err)
        }