Skip to content

Commit

Permalink
cmd/go: adjust test with tricky ld flags to not run on Darwin
Browse files Browse the repository at this point in the history
normally this would not run on darwin anyway, but if there
happens to be a "pkg-config" binary, then it will.  Darwin's
clang/linker does not have this flag.

Change-Id: I61929cf193c95b420441187beb8b237fa1037807
Reviewed-on: https://go-review.googlesource.com/c/go/+/616376
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
  • Loading branch information
dr2chase committed Oct 4, 2024
1 parent d39bfaf commit 2f50798
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cmd/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1505,13 +1505,16 @@ func main() {
tg.setenv("PKG_CONFIG_PATH", tg.path("."))
tg.run("run", tg.path("foo.go"))

// test for ldflags
tg.tempFile("bar.pc", `
if runtime.GOOS != "darwin" { // darwin doesn't like these ldflags
// test for ldflags
tg.tempFile("bar.pc", `
Name: bar
Description: The bar library
Version: 1.0.0
Libs: -Wl,-rpath=/path\ with\ spaces/bin
`)
}

tg.tempFile("bar.go", `package main
/*
#cgo pkg-config: bar
Expand Down

0 comments on commit 2f50798

Please sign in to comment.