Crafter.Build/interfaces
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf dc8e9e6f9e
feat(test): give a test that sets Test::wayland a compositor of its own
A test that opens a window opened it on the display of whoever ran the
suite: every `crafter-build test` of Crafter.Graphics put the windows
of its window tests on the desktop, and its other GPU tests connect to
the session's compositor too, since Device::Initialize calls
wl_display_connect whether a window follows or not.

A test that sets the new Test::wayland (TestBuilder::Wayland) now runs
with a headless compositor started for it alone. RunSingleTest starts
the compositor through sh, with XDG_RUNTIME_DIR naming a directory made
for it and without WAYLAND_DISPLAY, WAYLAND_SOCKET or DISPLAY, waits up
to 30 s for a wayland-<n> socket in that directory, runs the test with
WAYLAND_DISPLAY set to the socket's path and with DISPLAY and
WAYLAND_SOCKET unset, then stops the compositor's process group and
removes the directory. The test's command is env with those changes,
and env's command is sh, which execs the test's words: env takes every
word with an '=' in it ahead of its command for an assignment, a
binary's path among them. The compositor runs under timeout(1) as long
as the test may, the wait and 30 s more, and with no limit for a test
that has none, a timeout of 0. It is weston on its headless backend
with its GL renderer, unless CRAFTER_BUILD_COMPOSITOR or the new
--compositor= names another command; `host` gives the tests the
session's own display instead, to watch them. A compositor that ends
before it listens, sh not finding it included, or does not listen in
time fails the test with what it printed. A test that may run where its
compositor is missing declares it in requires_ (tool:weston for the
default), the check RunTests makes before the build, so no skip of its
own is added, and no probe of the command: the command is any sh
command, whose first word need not be the compositor. A test that
fails, crashes or times out keeps what its compositor printed
(TestResult::compositorLog), which RunTests writes to
build/test-logs/<name>.compositor.log, and says when the compositor
ended while it ran.

One compositor per test rather than one per run: no two tests share
one, so tests that run at once cannot cover each other's windows or
take each other's focus, for weston's start-up on every test. weston's
GL renderer, because it imports the dmabufs that a GPU's Vulkan driver
presents, as Mesa's and NVIDIA's do, and the headless backend's default
renderer and pixman import none: against pixman, the NVIDIA driver
reports no format for a window's surface, and Crafter.Graphics's
FrameLoopSync stops at its formatCount > 0 assertion. weston cannot
run the test itself, as `weston -- <test>` exits 0 whatever the test
returned, so crafter-build runs the compositor beside it.

:Platform gains BackgroundCommand, the compositor's process, and
PrivateDirectory, its directory. The process is forked with
PR_SET_PDEATHSIG and runs under `timeout`, which passes the SIGTERM it
gets when crafter-build dies on to the compositor's group, so a
crafter-build killed by Ctrl-C leaves no compositor running. The
directory is made in $XDG_RUNTIME_DIR, or in /tmp where that is not a
directory, rather than in the temp directory, since a socket's path
holds 107 bytes, and is flocked while in use; one that a killed
crafter-build left is removed when the next is made beside it, once it
has not changed for a minute.

New members and a parameter with a default, nothing removed: a minor
release.
2026-11-28 11:05:51 +01:00
..
Crafter.Build-Agents.cppm feat: let a project file return several configurations 2026-11-15 02:16:06 +01:00
Crafter.Build-Asset.cppm refactor: drop Windows host support 2026-10-02 22:03:34 +02:00
Crafter.Build-Clang.cppm feat(test): give a test that sets Test::wayland a compositor of its own 2026-11-28 11:05:51 +01:00
Crafter.Build-External.cppm feat: let a project file return several configurations 2026-11-15 02:16:06 +01:00
Crafter.Build-Flatpak.cppm feat: install a Flatpak's data under /app/share 2026-11-09 01:55:31 +01:00
Crafter.Build-Implementation.cppm fix(build): read what a source declares and imports with clang-scan-deps 2026-11-27 09:25:53 +01:00
Crafter.Build-Interface.cppm fix(build): read what a source declares and imports with clang-scan-deps 2026-11-27 09:25:53 +01:00
Crafter.Build-Jobs.cppm feat(build): run a build's steps on one worker per hardware thread 2026-11-13 17:59:55 +01:00
Crafter.Build-Lint.cppm feat: let a project file return several configurations 2026-11-15 02:16:06 +01:00
Crafter.Build-Platform.cppm feat(test): give a test that sets Test::wayland a compositor of its own 2026-11-28 11:05:51 +01:00
Crafter.Build-Progress.cppm feat(build): run a build's steps on one worker per hardware thread 2026-11-13 17:59:55 +01:00
Crafter.Build-Script.cppm feat: let a project file return several configurations 2026-11-15 02:16:06 +01:00
Crafter.Build-Shader.cppm fix: rebuild and relink on what changed, submodules at their revisions, and mingw found where it is 2026-10-20 20:20:29 +02:00
Crafter.Build-Test.cppm feat(test): give a test that sets Test::wayland a compositor of its own 2026-11-28 11:05:51 +01:00
Crafter.Build-Toolchain.cppm fix(lint): look for libc++ where the compiler does 2026-11-27 16:16:38 +01:00
Crafter.Build.cppm feat(build): run a build's steps on one worker per hardware thread 2026-11-13 17:59:55 +01:00