test: a test's headless compositor, from its start to its cleanup
HeadlessCompositor drives RunSingleTest with itself in every part. The harness starts it again as the compositor, which listens on a wayland-7 socket in the XDG_RUNTIME_DIR it is given and records its environment, and as the test, which records its own and connects. A test that sets wayland passes against its compositor and runs with WAYLAND_DISPLAY naming the compositor's socket, without DISPLAY and WAYLAND_SOCKET, and with the XDG_RUNTIME_DIR of the process that runs it. The compositor gets a directory of its own in that one, or in /tmp where that process has none, and none of the WAYLAND_DISPLAY, WAYLAND_SOCKET and DISPLAY that process has, each given a value of the session's in the driver, and afterwards it has been sent SIGTERM, is gone and so is its directory. The compositor's timeout(1) is the test's, the wait for its socket and 30 s more, and none for a test with no time limit; and a test whose binary's path has an '=' in it runs as any other. A test that does not set wayland, and one run under `host`, keep that display. Without an override CRAFTER_BUILD_COMPOSITOR names the compositor, and an override wins over it. A compositor sh cannot find fails the test with status 127, named, and a line on how a test that may run without it is skipped; one that ends before it listens fails it with its status and what it printed, checked on a word the command does not hold, without running the test; a failing test keeps what its compositor printed; a compositor killed while the test runs is reported as ended. A stand-in crafter-build killed in the middle of a test has its compositor sent SIGTERM and gone, and the directory it leaves is removed when the next is made, once dated past the minute, while one changed a moment ago and one that is held stay. Without PR_SET_PDEATHSIG the two checks on the killed crafter-build fail, and without the removal of abandoned directories the one on its directory does; with the test's own words as env's command, the check on the binary whose path has an '=' fails, with a limit of its own for the compositor of a test with none the one on that limit does, without what the compositor printed in the failure the one on that, with WAYLAND_SOCKET left to the compositor and the test the ones on it, and without the command in the failure of a compositor sh cannot find the one on that, which looks for the harness's words, not sh's. No weston is needed, so the suite runs it in the native loop and in the Flatpak's build sandbox alike. The driver makes its compositors' directories in a directory of its own 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 a temp directory's path can use them up; its check without an XDG_RUNTIME_DIR has the harness make that compositor's directory in /tmp itself, as crafter-build does where there is none. The driver's directory is a PrivateDirectory, now exported for it, so that one a killed driver left goes when a later one is made, once it has not changed for a minute, and AGENTS.template.md's line on where tests write now says that what a test runs writes caches of its own, crafter-build's builds and wasmtime the modules the wasm tests run, and names this test as the one that writes anywhere else.
This commit is contained in:
parent
dc8e9e6f9e
commit
67e97d0a2a
4 changed files with 496 additions and 2 deletions
|
|
@ -314,6 +314,7 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
|
|||
cfg.AddTest("WasmBuildRefusals").Dependencies({ CrafterBuildLib.get() });
|
||||
cfg.AddTest("WasmSysrootKey").Dependencies({ CrafterBuildLib.get() });
|
||||
cfg.AddTest("RunSingleTestExit").Dependencies({ CrafterBuildLib.get() });
|
||||
cfg.AddTest("HeadlessCompositor").Dependencies({ CrafterBuildLib.get() });
|
||||
// Loading a project file dlopens the project.so compiled from it,
|
||||
// which references Crafter:: symbols (HostTarget, Configuration
|
||||
// ctors) that have to be visible from the test exe — same wiring
|
||||
|
|
|
|||
Loading…
Reference in a new issue