From: Quentin Smith Date: Thu, 10 Nov 2016 16:45:56 +0000 (-0500) Subject: cmd/go: skip TestCgoPkgConfig if pkg-config is too old X-Git-Tag: go1.8beta1~189 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=02d79e95581e53edca21f0c105675b3f459ee736;p=gostls13.git cmd/go: skip TestCgoPkgConfig if pkg-config is too old pkg-config 0.24 adds support for quoting and escaping whitespace; distros like CentOS 6 are still shipping pkg-config 0.23. Skip the test there since there's no way to get whitespace into the pkg-config output. Fixes #17846. Change-Id: Ie4ea17e9b709372a20178b539498929754bcd51f Reviewed-on: https://go-review.googlesource.com/33027 Run-TryBot: Quentin Smith TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 456e1b669a..320c041265 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -2345,8 +2345,9 @@ func TestCgoPkgConfig(t *testing.T) { tg.parallel() tg.run("env", "PKG_CONFIG") - if _, err := exec.LookPath(strings.TrimSpace(tg.getStdout())); err != nil { - t.Skip("skipping because pkg-config could not be found") + pkgConfig := strings.TrimSpace(tg.getStdout()) + if out, err := exec.Command(pkgConfig, "--atleast-pkgconfig-version", "0.24").CombinedOutput(); err != nil { + t.Skipf("%s --atleast-pkgconfig-version 0.24: %v\n%s", pkgConfig, err, out) } // OpenBSD's pkg-config is strict about whitespace and only