diff --git a/.builds/linux.yml b/.builds/linux.yml index c7922bc5..e0a5af23 100644 --- a/.builds/linux.yml +++ b/.builds/linux.yml @@ -36,7 +36,7 @@ tasks: - test_cmd: | cd gio/cmd go test ./... - GOFLAGS=-race go test ./... + go test -race ./... - check_gofmt: | cd gio test -z $(gofmt -s -l .) diff --git a/cmd/gogio/wayland_test.go b/cmd/gogio/wayland_test.go index bd93aa77..5294d07d 100644 --- a/cmd/gogio/wayland_test.go +++ b/cmd/gogio/wayland_test.go @@ -72,7 +72,12 @@ func (d *WaylandTestDriver) Start(t_ *testing.T, path string, width, height int) cleanups = append(cleanups, func() { os.RemoveAll(dir) }) bin := filepath.Join(dir, "red") - cmd := exec.Command("go", "build", "-tags", "nox11", "-o="+bin, path) + flags := []string{"build", "-tags", "nox11", "-o="+bin} + if raceEnabled { + flags = append(flags, "-race") + } + flags = append(flags, path) + cmd := exec.Command("go", flags...) if out, err := cmd.CombinedOutput(); err != nil { d.t.Fatalf("could not build app: %s:\n%s", err, out) } diff --git a/cmd/gogio/x11_test.go b/cmd/gogio/x11_test.go index 8df1cf6a..88b965fd 100644 --- a/cmd/gogio/x11_test.go +++ b/cmd/gogio/x11_test.go @@ -69,7 +69,12 @@ func (d *X11TestDriver) Start(t_ *testing.T, path string, width, height int) (cl cleanups = append(cleanups, func() { os.RemoveAll(dir) }) bin := filepath.Join(dir, "red") - cmd := exec.Command("go", "build", "-tags", "nowayland", "-o="+bin, path) + flags := []string{"build", "-tags", "nowayland", "-o="+bin} + if raceEnabled { + flags = append(flags, "-race") + } + flags = append(flags, path) + cmd := exec.Command("go", flags...) if out, err := cmd.CombinedOutput(); err != nil { d.t.Fatalf("could not build app: %s:\n%s", err, out) }