]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: skip TestCgoPkgConfig if pkg-config is too old
authorQuentin Smith <quentin@golang.org>
Thu, 10 Nov 2016 16:45:56 +0000 (11:45 -0500)
committerQuentin Smith <quentin@golang.org>
Fri, 11 Nov 2016 22:16:47 +0000 (22:16 +0000)
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 <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/go_test.go

index 456e1b669ae96900346456d8f304b61718398638..320c04126588eaee9d6cd20d55a03bdd9edc24b9 100644 (file)
@@ -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