mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 17:56:45 +08:00
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.
This commit is contained in:
committed by
GitHub
parent
f95340ae1b
commit
4e242098f8
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user