Skip to content

Commit

Permalink
tests: check presence of gcc for cgo tests (#2644)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aarzilli committed Aug 4, 2021
1 parent f95340a commit 4e24209
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/proc/test/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4e24209

Please sign in to comment.