未验证 提交 4e242098 编写于 作者: A Alessandro Arzilli 提交者: GitHub

tests: check presence of gcc for cgo tests (#2644)

The install of gcc sometimes fails on our CI, it is not an error if the
tests for cgo can not run because there's no C compiler.
上级 f95340ae
......@@ -367,7 +367,11 @@ var hasCgo = func() bool {
if err != nil {
panic(err)
}
return strings.TrimSpace(string(out)) == "1"
if strings.TrimSpace(string(out)) != "1" {
return false
}
_, err = exec.LookPath("gcc")
return err == nil
}()
func MustHaveCgo(t *testing.T) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册