From 02d79e95581e53edca21f0c105675b3f459ee736 Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Thu, 10 Nov 2016 11:45:56 -0500 Subject: [PATCH] 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 --- src/cmd/go/go_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.48.1