Recent activity

[PATCH] cmd/gogio: start using testing.T.Cleanup 7 days ago

From Daniel Martí to ~eliasnaur/gio-patches

Now that we use tip due to breaking changes in Go's JS APIs, let's
replace our hacky cleanup list code with 1.14's upcoming
testing.T.Cleanup.

Adding more deliberate uses of tip would ususally be best avoided, but
these will only affect developers working on gio's tests, not regular
users of gio.

While at it, remove some debug t.Logf calls I forgot to remove.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
---
 cmd/gogio/e2e_test.go     | 11 ++---------
 cmd/gogio/js_test.go      | 12 +++++-------
[message trimmed]

[PATCH] cmd/gogio: join all endtoend tests as subtests 7 days ago

From Daniel Martí to ~eliasnaur/gio-patches

This means we can deduplicate some of the logic, and keep it all in one
place.

Start expanding the logic too; the tests are slow, so they should be
skipped on 'go test -short'. The ones we have so far all run in a matter
of seconds on an average laptop today, but future tests will probably
require heavier work like wine or kvm.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
---
 cmd/gogio/e2e_test.go     | 26 ++++++++++++++++++++++++++
 cmd/gogio/js_test.go      |  6 ------
 cmd/gogio/wayland_test.go |  6 ------
 cmd/gogio/x11_test.go     |  6 ------
[message trimmed]

[PATCH v2] cmd/gogio: simplify the test -race setup 9 days ago

From Daniel Martí to ~eliasnaur/gio

In an earlier commit, we made it possible to run the e2e tests with the
race detector enabled everywhere via GOFLAGS=-race go test.

However, that's not at all standard; most users will simply use 'go test
-race'. Moreover, having 'go test -race' run the test program with the
race detector, but not the e2e gio app, is a bit useless.

Instead, have the tests detect when they run with the race detector, and
enable the race detector in the test app too. As before, the JS test is
skipped whenever -race is used.

This also means we can test with -race in the same way in each of the
modules, which simplifies CI.
[message trimmed]

[PATCH] cmd/gogio: fix a couple of staticcheck positives 10 days ago

From Daniel Martí to ~eliasnaur/gio

Spotted the javac one by chance when reading the code, so I ran the tool
and fixed another small bug while at it.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
---
 cmd/gogio/androidbuild.go | 3 +++
 cmd/gogio/main.go         | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/cmd/gogio/androidbuild.go b/cmd/gogio/androidbuild.go
index 435e263..b651728 100644
--- a/cmd/gogio/androidbuild.go
+++ b/cmd/gogio/androidbuild.go
@@ -151,6 +151,9 @@ func compileAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err erro
[message trimmed]

[PATCH] cmd/gogio: simplify the test -race setup 10 days ago

From Daniel Martí to ~eliasnaur/gio

In an earlier commit, we made it possible to run the e2e tests with the
race detector enabled everywhere via GOFLAGS=-race go test.

However, that's not at all standard; most users will simply use 'go test
-race'. Moreover, having 'go test -race' run the test program with the
race detector, but not the e2e gio app, is a bit useless.

Instead, have the tests detect when they run with the race detector, and
enable the race detector in the test app too. As before, the JS test is
skipped whenever -race is used.

This also means we can test with -race in the same way in each of the
modules, which simplifies CI.
[message trimmed]

[PATCH] cmd/gogio: support running e2e with and without -race 11 days ago

From Daniel Martí to ~eliasnaur/gio

Right now, we can only run the e2e gio app with -race, not without
-race, because the flag is hard-coded in the tests.

The reason for this change was that 'GOFLAGS=-race go test' would fail
with the JS test, since js/wasm doesn't support the race detector. Fix
that by skipping the JS test when -race is used.

Now, we can run multiple levels of -race:

	go test               # no -race at all
	go test -race         # -race for the tests, not the e2e gio app
	GOFLAGS=-race go test # -race for everything (best-effort)

To detect the race detector being on, we use a file with a build tag.
[message trimmed]

[PATCH] cmd/gogio: first wayland end-to-end tests 11 days ago

From Daniel Martí to ~eliasnaur/gio

Clicking doesn't quite work yet, but everything else does. We use a
custom sway config to ensure that it's a minimalist setup with no bar or
borders, like the other drivers.

The generic test now adapts to the window's real size when running in
non-headless mode, since tiling window managers resize some drivers like
sway. The default headless mode still expects the exact size that we
specify, as no real windows are at play.

While at it, clean up some now unused code from the x11 file.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
---
 cmd/gogio/e2e_test.go     |  44 ++++---
[message trimmed]

[PATCH] cmd/gogio: remove sleeps in x11 e2e test 12 days ago

From Daniel Martí to ~eliasnaur/gio

We can instead synchronize with the gio app via stdout. We need three
states, since we need to first invalidate a frame and then print when
the next frame is drawn.

This is not happening on the JS test yet, because stdout printing
crashes in that case. See the comment.

This change should make the X11 test a bit faster on fast machines,
while making it more stable in small or headless machines like CI.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
---
 cmd/gogio/e2e_test.go     |  5 +++--
 cmd/gogio/testdata/red.go | 32 ++++++++++++++++++++++++++++++++
[message trimmed]

[PATCH] cmd/gogio: rip out cgo deps for x11 12 days ago

From Daniel Martí to ~eliasnaur/gio

Instead rely on more tiny standalone tools. In this case, scrot lets us
take png screenshots, and works well.

On the plus side, we remove some large X Go deps, and we don't need
nearly as much code.

While at it, skip if any of the tools are missing, and actually defer
the cleanup funcs so that they run when we fail the test early.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
---
 cmd/go.mod            |  4 ----
 cmd/go.sum            |  6 -----
 cmd/gogio/e2e_test.go | 10 ++++----
[message trimmed]

[PATCH] cmd/gogio: add clicks to the e2e tests 12 days ago

From Daniel Martí to ~eliasnaur/gio

The test app now responds to mouse clicks; clicking on one of the four
sections of the app flips it to red color until clicked again.

Add a Click method to the TestDriver interface, and implement it in both
of the current drivers. Unfortunately, I failed at implementing it in
X11 with the xdg library, after a few wasted hours. Instead, start
relying on more external tools which are simple to use and not heavy to
install.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
---
 cmd/gogio/e2e_test.go     | 108 +++++++++++++++++++++-----------------
 cmd/gogio/js_test.go      |  13 +++++
 cmd/gogio/testdata/red.go |  67 +++++++++++++++++------
[message trimmed]