Merge pull request #3506 from dotCooCoo/fix/test-kit-unused-items

ui-contract: gate the suite trials' Layer re-export and lookup count on suite
This commit is contained in:
BFlat
2026-11-26 09:56:22 +07:00
committed by GitHub
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ pub use state_layer::{StateLayer, StateLayerKind};
pub(crate) use surface::{Frames as SurfaceFrames, SurfaceSlot, fit_to_frame};
pub use surface::{Surface, frame_surfaces};
pub use surround::paint_surround;
#[cfg(feature = "testing")]
#[cfg(feature = "suite")]
pub(crate) use svg_set::Layer;
pub use svg_set::{AppIcons, register_app_icons};
pub use text::{ChordText, HAlign, LayoutRun, LeastLayout, ReadingMeasure, Span, TextLayout, TextRun, Wrap};
+6 -3
View File
@@ -254,7 +254,7 @@ pub(crate) struct Shapes {
#[cfg(feature = "testing")]
resolutions: u32,
/// The `made_by_component` lookups the running pass made, for the count trials.
#[cfg(feature = "testing")]
#[cfg(feature = "suite")]
made_lookups: u32,
}
@@ -388,6 +388,9 @@ pub(crate) fn begin(ctx: &Context, hit: HitSizes, latched: craft_keymap::Mods) {
#[cfg(feature = "testing")]
{
shapes.resolutions = 0;
}
#[cfg(feature = "suite")]
{
shapes.made_lookups = 0;
}
});
@@ -858,7 +861,7 @@ pub(crate) fn registered_widgets(ctx: &Context) -> std::collections::HashSet<Id>
/// editor part, in the running pass of `viewport`.
pub(crate) fn made_by_component(ctx: &Context, viewport: ViewportId, id: Id) -> bool {
PerViewport::<Shapes>::with(ctx, viewport, |record| {
#[cfg(feature = "testing")]
#[cfg(feature = "suite")]
{
record.made_lookups += 1;
}
@@ -867,7 +870,7 @@ pub(crate) fn made_by_component(ctx: &Context, viewport: ViewportId, id: Id) ->
}
/// How many `made_by_component` lookups the running pass of `viewport` made so far, for the count trials.
#[cfg(feature = "testing")]
#[cfg(feature = "suite")]
pub(crate) fn made_lookups(ctx: &Context, viewport: ViewportId) -> u32 {
PerViewport::<Shapes>::with(ctx, viewport, |record| record.made_lookups)
}