}
func testMain(m *testing.M) int {
- if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
+ if testing.Short() && testenv.Builder() == "" {
globalSkip = func(t testing.TB) { t.Skip("short mode and $GO_BUILDER_NAME not set") }
return m.Run()
}
func testMain(m *testing.M) int {
log.SetFlags(log.Lshortfile)
flag.Parse()
- if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
+ if testing.Short() && testenv.Builder() == "" {
globalSkip = func(t *testing.T) { t.Skip("short mode and $GO_BUILDER_NAME not set") }
return m.Run()
}
}
func testMain(m *testing.M) int {
- if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
+ if testing.Short() && testenv.Builder() == "" {
globalSkip = func(t *testing.T) { t.Skip("short mode and $GO_BUILDER_NAME not set") }
return m.Run()
}
// TestMain calls testMain so that the latter can use defer (TestMain exits with os.Exit).
func testMain(m *testing.M) (int, error) {
- if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
+ if testing.Short() && testenv.Builder() == "" {
globalSkip = func(t testing.TB) { t.Skip("short mode and $GO_BUILDER_NAME not set") }
return m.Run(), nil
}
}
func TestTrivialPIE(t *testing.T) {
- if strings.HasSuffix(os.Getenv("GO_BUILDER_NAME"), "-alpine") {
+ if strings.Contains(testenv.Builder(), "-alpine") {
t.Skip("skipping on alpine until issue #54354 resolved")
}
globalSkip(t)
if runtime.GOOS != "darwin" {
t.Skip("skipping on non-darwin platform")
}
- if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
+ if testing.Short() && testenv.Builder() == "" {
t.Skip("skipping in -short mode with $GO_BUILDER_NAME empty")
}
if err := testenv.Command(t, "xcrun", "--help").Run(); err != nil {
import (
"fmt"
+ "internal/testenv"
"os"
"path/filepath"
"slices"
}
}
func testGetdirentries(t *testing.T, count int) {
- if count > 100 && testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
+ if count > 100 && testing.Short() && testenv.Builder() == "" {
t.Skip("skipping in -short mode")
}
d := t.TempDir()