apptest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 10 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 after ten seconds.

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 after ten seconds.

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 after ten seconds.

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 ShmResident

func ShmResident(t *testing.T) int

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.

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 after ten seconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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