Fail when the last film stock cannot be reached
The film list bug gave no failure anywhere: the data was right, the markup compiled, and the list rendered. Two guards now check that the list can be walked to its end, both by driving input rather than by reading markup. tests/film_list_reaches_every_stock.rs runs in CI and needs no display. It builds the real AppWindow on Slint's testing backend and gives it 28 stocks. It dispatches window events through the same routing a window uses: popup, Flickables, arbitration. It then checks that the last stock is on screen, that is, not clipped away: - after Down past the end, and that Enter chooses it; - after drags on the list; - after a run of wheel events with a still pointer; - after dragging the scrollbar thumb. Element queries need the Slint compiler's debug tables, which build.rs emitted only for the `automation` feature. It now emits them for every debug build too. Release builds, the ones that ship, are unchanged. The testing backend is a dev-dependency at the same pinned version the automation feature already uses, so no new crate enters the lockfile. The test is compiled out of release test runs. film_reach in tools/manual/scenes.py is the same check on the recording rig: a real X pointer from xdotool, the release build, and the demo library. It makes no picture, so it adds nothing to the manual. It runs with every recording, or alone with `record.sh LIBRARY film_reach`, and fails the run if the last stock (Ilford HP5 Plus) is out of reach by the wheel, a drag, the scrollbar or the keys. Both have to add the popup's position back. The testing backend reports anything inside a popup relative to the popup, and so does the automation hook built on it. They take the popup's position from the Film row and Slint's clamp into the window.
This commit is contained in:
@@ -168,3 +168,7 @@ env_logger.workspace = true
|
||||
# Standing in a test backend behind `dyn RemoteBackend`, which is an
|
||||
# `#[async_trait]` trait — implementing one needs the same attribute.
|
||||
async-trait.workspace = true
|
||||
# Runs the interface without a display: the film list's reachability test
|
||||
# drives the real window's event dispatch on Slint's testing backend. The same
|
||||
# pinned release as the `automation` dependency above, so nothing new is built.
|
||||
i-slint-backend-testing = { version = "=1.17.1", default-features = false }
|
||||
|
||||
Reference in New Issue
Block a user