diff --git a/cmd/gogio/e2e_test.go b/cmd/gogio/e2e_test.go index de7017f3..e269c5fe 100644 --- a/cmd/gogio/e2e_test.go +++ b/cmd/gogio/e2e_test.go @@ -9,6 +9,8 @@ import ( "testing" ) +var raceEnabled = false + var headless = flag.Bool("headless", true, "run end-to-end tests in headless mode") // TestDriver is implemented by each of the platforms we can run end-to-end diff --git a/cmd/gogio/js_test.go b/cmd/gogio/js_test.go index 627a24af..92cb5882 100644 --- a/cmd/gogio/js_test.go +++ b/cmd/gogio/js_test.go @@ -33,6 +33,10 @@ type JSTestDriver struct { func (d *JSTestDriver) Start(t_ *testing.T, path string, width, height int) (cleanups []func()) { d.t = t_ + if raceEnabled { + d.t.Skipf("js/wasm doesn't support -race; skipping") + } + // First, build the app. dir, err := ioutil.TempDir("", "gio-endtoend-js") if err != nil { diff --git a/cmd/gogio/race_test.go b/cmd/gogio/race_test.go new file mode 100644 index 00000000..07499364 --- /dev/null +++ b/cmd/gogio/race_test.go @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: Unlicense OR MIT + +// +build race + +package main_test + +func init() { raceEnabled = true } diff --git a/cmd/gogio/wayland_test.go b/cmd/gogio/wayland_test.go index d98f2279..bd93aa77 100644 --- a/cmd/gogio/wayland_test.go +++ b/cmd/gogio/wayland_test.go @@ -72,7 +72,7 @@ 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", "-race", "-tags", "nox11", "-o="+bin, path) + cmd := exec.Command("go", "build", "-tags", "nox11", "-o="+bin, path) 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 05a1f147..8df1cf6a 100644 --- a/cmd/gogio/x11_test.go +++ b/cmd/gogio/x11_test.go @@ -69,7 +69,7 @@ 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", "-race", "-tags", "nowayland", "-o="+bin, path) + cmd := exec.Command("go", "build", "-tags", "nowayland", "-o="+bin, path) if out, err := cmd.CombinedOutput(); err != nil { d.t.Fatalf("could not build app: %s:\n%s", err, out) }