Commit Graph

40 Commits

Author SHA1 Message Date
Elias Naur 140888ec86 example/glfw: add example demonstrating GLFW integration
Updates gio#26

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-02-07 23:15:05 +01:00
Aaron Bieber ff6c798a28 app: Extend CI to build on OpenBSD now that golang.org/x/sys is updated.
I was able to get the Pipe2 syscall added for OpenBSD:
https://go.googlesource.com/sys/+/9fbb57f87de9ccfe3a99d4e3270ce8a926ebba4f

This also updates the dependencies to include the latest sys and gio.

I submitted a patch to the builder environment to include the xshare sets on
OpenBSD. Once that is in it will mean the "install_deps" block can be removed.

  https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/9640

Here is a link to a successful build: https://builds.sr.ht/~qbit/job/143004

Signed-off-by: Aaron Bieber <aaron@bolddaemon.com>
2020-01-28 17:21:01 +01:00
Elias Naur 0bfcac9734 cmd,example: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-12 00:48:31 +01:00
Elias Naur 31ebd9e811 cmd,example: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-04 00:32:36 +01:00
Elias Naur 1762e0c07b cmd,example: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-02 13:20:20 +01:00
Daniel Martí 5bddf66db7 cmd: update the chromedp version
It's a bugfix release, and we want some of the stability fixes in it.
Starting Chrome processes is more reliable now, for example.

See https://github.com/chromedp/chromedp/releases/tag/v0.5.2.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2019-12-02 11:01:17 +01:00
Elias Naur 6a2b5a8d3b example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 20:28:06 +01:00
Elias Naur 76c209b594 example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 18:36:34 +01:00
Elias Naur 26f34a3331 example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-18 15:05:12 +01:00
Elias Naur d8c9cb426c example/gophers: update gio version
gofmt -w -s . as well.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-09 19:46:10 +01:00
Elias Naur 294308d8aa example/gophers: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-08 22:22:41 +01:00
Elias Naur c4416ffbc4 example/gophers: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-08 18:04:56 +01:00
Elias Naur 508f615f0b example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-07 18:51:32 +01:00
Elias Naur b0c29b5489 example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-06 18:04:52 +01:00
Elias Naur c3533c3f84 example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-06 17:32:21 +01:00
Elias Naur 1438e504cc example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-05 18:25:27 +01:00
Elias Naur c2cab4505c example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-04 19:32:07 +01:00
Elias Naur 615840352e example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-04 19:11:32 +01:00
Elias Naur 513b19b2c5 example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-04 18:47:18 +01:00
Elias Naur 1110ed1aed example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-04 16:40:09 +01:00
Elias Naur 90de8b6360 example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-04 15:17:42 +01:00
Elias Naur 65146a5337 example/kitchen: add CheckBox example
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-04 00:42:02 +01:00
Elias Naur dde09b9d74 example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-02 16:09:07 +01:00
Daniel Martí b8e996074b cmd/gogio: rip out cgo deps for x11
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>
2019-11-02 01:19:19 +01:00
Greg Pomerantz 3cd633ee44 cmd/gogio: Android: include jar files from dependencies
On Android, in addition to adding jar files found in the source
directory of the program being compiled, cmd/gogio also searches
every dependency for jar files to include in the output APK.

Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
2019-11-01 17:59:49 +01:00
Elias Naur ff8879ddce example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-30 20:43:45 +01:00
Elias Naur 3945302b4f example,cmd: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-30 14:05:56 +01:00
Elias Naur 6d9dccdbaa cmd,example: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-30 00:58:35 +01:00
Daniel Martí cea8dc374b cmd/gogio: add the first end-to-end X11 test
Right now it's very similar to the JS test on Chrome. Like it, this one
just runs the "red.go" gio app, takes a screenshot, and expects to see
red.

It also supports the -headless flag; when true, Xvfb is used and it's
entirely headless and hidden. Otherwise, Xephyr is used and once can see
the test in action. If the tool isn't installed, the test is skipped.

We need to add xgb as a dependency, so that we can connect to the X
server and interact with it, like taking screenshots.

Finally, this is an initial version, and a number of TODOs are left for
a later time. They'll get fixed in follow-up patches.

While at it, start making all tests parallel, since the end-to-end tests
take about a second each and neither are very cpu-intensive.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2019-10-29 20:01:52 +01:00
Elias Naur 4793faeadd cmd,example: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-29 14:08:38 +01:00
Daniel Martí 4641607cd6 cmd/gogio: log chrome's console messages in TestJSOnChrome
For example, if the browser doesn't have webgl at all, the gio app will
fail to load. This will result in the screenshot being incorrect,
without an apparent reason:

	--- FAIL: TestJSOnChrome (0.89s)
	    js_test.go:122: got 0xffffffffffffffff at (5,5), want 0xffff00000000ffff
	    js_test.go:122: got 0xffffffffffffffff at (595,595), want 0xffff00000000ffff

The underlying webgl error was accessible if one added a sleep and ran
'go test -headless=false', allowing to open the console and see the
error messages.

Instead, capture them via chromedp and print them to the test's logger:

	--- FAIL: TestJSOnChrome (0.89s)
	    js_test.go:79: console log: "2019/10/29 12:41:07 app: webgl is not supported"
	    js_test.go:79: console warning: "exit code:", 1
	    js_test.go:122: got 0xffffffffffffffff at (5,5), want 0xffff00000000ffff
	    js_test.go:122: got 0xffffffffffffffff at (595,595), want 0xffff00000000ffff

JS Exceptions are a completely different mechanism, so they're not
covered by this patch. We can add them at a later time if needed.

While at it, update to the latest tagged version of chromedp.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2019-10-29 14:06:30 +01:00
Elias Naur b46206e60a cmd,example: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-29 01:38:16 +01:00
Elias Naur 3de204b8ef cmd/gogio/testdata: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-27 15:42:18 +01:00
Elias Naur fc521ec1ff cmd/gogio: update gio version
The path of the supporting Android Java files and iOS header file
moved.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-14 16:43:21 +02:00
Elias Naur 651e31f7e0 cmd/gogio: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-12 15:42:47 +02:00
Elias Naur 6bc5ff2479 apps: updates for renamed and moved packages
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-30 17:00:22 +02:00
Elias Naur 962bc36dac apps,cmd: update to renamed gioui.org module
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-30 12:41:29 +02:00
Daniel Martí 687ea833a3 cmd/gogio: add the first end-to-end test for js via chrome
This commit adds the first fully end-to-end test. It builds a very
simple Gio app, loads it on Chrome, and checks that it works.

To control Chrome, we use chromedp, a library in pure Go that takes care
of starting the browser and talking to it via the devtools protocol.

We add the test directly in the cmd module, since it mainly interacts
with the gogio tool, and also because the code might turn into some sort
of 'gogio test' command in the future. This does add chromedp and ui as
test dependencies to go.mod, but GOPROXY should allow a 'go get' of
gogio to not download their entire source code archives.

We don't replace ui with ../../ui in the go.mod, to ensure that testing
the cmd module works from anywhere without unintended differences.

The test app being used is inside a testdata directory, to ensure it's
not go-gettable, and that it doesn't otherwise affect the cmd module.

Finally, the test itself is pretty simple. The app just paints a red
background, and the test verifies that, once loaded, the background of
the browser viewport is indeed red.

The test does currently require Chrome or Chromium to be installed,
which is fine for now. It may also require a GPU, though I don't have a
headless machine to check for sure. The test uses Chrome in headless
mode though, so it doesn't open up any visible browser window.

All in all, the test succeeds in just over a second on my laptop with
Chromium 77.0.3865.75.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2019-09-23 21:23:31 +02:00
Elias Naur 50599bc65d cmd/gio: support app icons
If there is an appicon.png file in the main package the gio tool
will use it for Android and iOS apps in buildmode exe.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-08-16 12:08:44 +02:00
Elias Naur 0f05231c35 all: initial import
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-03-31 10:47:22 +02:00