apptest

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package apptest runs a lys-ui application on a private headless sway for a test, and waits on what it does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Answer

func Answer[T any](t *testing.T, what string, answered <-chan T) T

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

func Drawn(t *testing.T, a *app.Application, surface *wl.Surface, invalidate func())

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 Never

func Never[T any](t *testing.T, what string, answered <-chan T)

Never waits out settle, failing the test with what if answered has an answer by then.

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 ShmHeld

func ShmHeld(t *testing.T) int

ShmHeld is how many bytes of lys-ui's shared-memory buffer pool this process holds: the pages its pool files have allocated, the pixels of every surface drawn on a compositor without the GPU path and of none it has let go. It reads the files, not the process's mapping of them, whose page tables a pool growth's remap starts afresh while the pages stay in the file.

func Until

func Until(t *testing.T, a *app.Application, what string, cond func() bool)

Until polls cond on a's loop until it holds, failing the test with what when it does not within waittest's limit.

func UntilSlow

func UntilSlow(t *testing.T, a *app.Application, what string, cond func() bool)

UntilSlow is Until for work the compositor or another process does, with waittest's slow limit.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL