| 1 | package testutils |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | "os" |
| 6 | "testing" |
| 7 | ) |
| 8 | |
| 9 | func ClangBin(tb testing.TB) string { |
| 10 | tb.Helper() |
| 11 | |
| 12 | if testing.Short() { |
| 13 | tb.Skip("Not compiling with -short") |
| 14 | } |
| 15 | |
| 16 | // Use a floating clang version for local development, but allow CI to run |
| 17 | // against oldest supported clang. |
| 18 | clang := "clang" |
| 19 | if minVersion := os.Getenv("CI_MIN_CLANG_VERSION"); minVersion != "" { |
| 20 | clang = fmt.Sprintf("clang-%s", minVersion) |
| 21 | } |
| 22 | |
| 23 | tb.Log("Testing against", clang) |
| 24 | return clang |
| 25 | } |