Documentation
¶
Overview ¶
Package apptest runs a lys-ui application on a private headless sway for a test, and waits on what it does.
Index ¶
- func Answer[T any](t *testing.T, what string, answered <-chan T) T
- func Dispatched(t *testing.T, a *app.Application)
- func Drawn(t *testing.T, a *app.Application, surface *wl.Surface, invalidate func())
- func Loop(t *testing.T) *app.Application
- func Never[T any](t *testing.T, what string, answered <-chan T)
- func On[T any](a *app.Application, fn func() T) T
- func Run(t *testing.T, env ...string) *app.Application
- func ShmResident(t *testing.T) int
- func Until(t *testing.T, a *app.Application, what string, cond func() bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Answer ¶
Answer waits for answered's answer, failing the test with what when none comes within waittest's limit.
func Dispatched ¶
func Dispatched(t *testing.T, a *app.Application)
Dispatched waits until a's loop has handled every event the compositor sent it before the call: the compositor answers a wl_display.sync after all it queued for the client ahead of it, and the loop dispatches in order. Input another client of the compositor injected and round-tripped has reached a's handlers when it returns. It fails the test when the answer does not come within waittest's limit.
func Drawn ¶
Drawn waits until the compositor has taken a frame of surface drawn after the call: invalidate owes the surface a draw, and that draw drains every invalidation made before it, so no frame is owed for them when Drawn returns. It fails the test when the frame does not come within waittest's limit.
func Loop ¶
func Loop(t *testing.T) *app.Application
Loop runs an application on the compositor WAYLAND_DISPLAY names for the rest of the test, as Run does on its sway.
func On ¶
func On[T any](a *app.Application, fn func() T) T
On runs fn on a's loop and returns its result.
func Run ¶
func Run(t *testing.T, env ...string) *app.Application
Run starts a private headless sway, env overriding its environment (swaytest.Start), and runs an application on it for the rest of the test. Cleanups the test registers afterwards run first, while the loop still runs.
func ShmResident ¶
ShmResident is how many bytes of lys-ui's shared-memory buffer pool are resident in this process: the pixels of every surface drawn on a compositor without the GPU path, and of none it has let go.
Types ¶
This section is empty.