From 3d8c80aa15efacea046edbc429c5e9a1393a509a Mon Sep 17 00:00:00 2001 From: Preetham Pemmasani <75422607+ppmpreetham@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:23:50 +0530 Subject: [PATCH 1/3] merge tests --- bindings/rust/Cargo.toml | 8 +++ .../blenderui/tests/{ => suite}/animation.rs | 0 .../blenderui/tests/{ => suite}/app_root.rs | 0 .../blenderui/tests/{ => suite}/basic_css.rs | 0 .../tests/{common/mod.rs => suite/common.rs} | 0 .../blenderui/tests/{ => suite}/css_redraw.rs | 0 .../tests/{ => suite}/damage_drag.rs | 0 .../blenderui/tests/{ => suite}/effects.rs | 0 .../blenderui/tests/{ => suite}/features.rs | 0 .../tests/{ => suite}/font_fallback.rs | 0 .../blenderui/tests/{ => suite}/gpu_turn.rs | 2 +- .../blenderui/tests/{ => suite}/headless.rs | 0 .../rust/blenderui/tests/{ => suite}/hooks.rs | 0 .../blenderui/tests/{ => suite}/images.rs | 0 .../tests/{ => suite}/listener_bounds.rs | 0 bindings/rust/blenderui/tests/suite/main.rs | 61 +++++++++++++++++++ .../blenderui/tests/{ => suite}/modern_css.rs | 0 .../blenderui/tests/{ => suite}/motion.rs | 0 .../tests/{ => suite}/motion_builders.rs | 0 .../tests/{ => suite}/motion_clip_move.rs | 0 .../tests/{ => suite}/motion_derived.rs | 0 .../tests/{ => suite}/motion_drag.rs | 0 .../tests/{ => suite}/motion_hover_under.rs | 0 .../tests/{ => suite}/motion_inview_scroll.rs | 0 .../tests/{ => suite}/motion_layout.rs | 0 .../tests/{ => suite}/motion_layout_parent.rs | 0 .../tests/{ => suite}/motion_loop.rs | 0 .../tests/{ => suite}/motion_presence.rs | 0 .../tests/{ => suite}/motion_redraw.rs | 0 .../tests/{ => suite}/motion_redraw_work.rs | 0 .../tests/{ => suite}/motion_scroll.rs | 0 .../tests/{ => suite}/motion_selector.rs | 0 .../tests/{ => suite}/motion_stale.rs | 0 .../tests/{ => suite}/motion_widgets.rs | 0 .../tests/{ => suite}/option_child.rs | 0 .../tests/{ => suite}/option_props.rs | 0 .../tests/{ => suite}/pangui_layout.rs | 2 +- .../blenderui/tests/{ => suite}/parity.rs | 2 +- .../tests/{ => suite}/perf_effects.rs | 2 +- .../tests/{ => suite}/render_target.rs | 2 +- .../rust/blenderui/tests/{ => suite}/rsx.rs | 0 .../blenderui/tests/{ => suite}/screen.rs | 0 .../tests/{ => suite}/scroll_into_view.rs | 0 .../tests/{ => suite}/scroll_replace.rs | 0 .../blenderui/tests/{ => suite}/selection.rs | 0 .../rust/blenderui/tests/{ => suite}/sound.rs | 0 .../tests/{ => suite}/struct_props.rs | 0 .../rust/blenderui/tests/{ => suite}/table.rs | 0 .../tests/{ => suite}/text_overflow.rs | 0 .../tests/{ => suite}/text_translate.rs | 0 .../tests/{ => suite}/textarea_grow.rs | 0 .../blenderui/tests/{ => suite}/titlebar.rs | 0 .../tests/{ => suite}/vector_transforms.rs | 0 .../rust/blenderui/tests/{ => suite}/vlist.rs | 0 .../tests/{ => suite}/vlist_custom.rs | 0 .../tests/{ => suite}/widget_clip.rs | 0 .../tests/{ => suite}/widget_layers.rs | 0 .../tests/{ => suite}/widget_through.rs | 0 docs/effects-performance.md | 4 +- docs/rust.md | 6 +- website/src/content/docs/concepts/screens.mdx | 2 +- .../content/docs/reference/binary-size.mdx | 2 +- .../src/content/docs/reference/coverage.mdx | 2 +- .../content/docs/rust/css-and-tailwind.mdx | 4 +- website/src/content/docs/rust/data-table.mdx | 4 +- .../docs/rust/effects-and-animations.mdx | 2 +- website/src/content/docs/rust/events.mdx | 2 +- .../content/docs/rust/headless-testing.mdx | 20 +++--- website/src/content/docs/rust/hooks.mdx | 4 +- .../src/content/docs/rust/html-elements.mdx | 2 +- website/src/content/docs/rust/layout.mdx | 2 +- website/src/content/docs/rust/motion.mdx | 2 +- .../content/docs/rust/rsx-and-components.mdx | 2 +- .../src/content/docs/rust/selecting-text.mdx | 2 +- .../rust/styled-and-blender-components.mdx | 2 +- .../src/content/docs/rust/virtual-list.mdx | 2 +- 76 files changed, 107 insertions(+), 38 deletions(-) rename bindings/rust/blenderui/tests/{ => suite}/animation.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/app_root.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/basic_css.rs (100%) rename bindings/rust/blenderui/tests/{common/mod.rs => suite/common.rs} (100%) rename bindings/rust/blenderui/tests/{ => suite}/css_redraw.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/damage_drag.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/effects.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/features.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/font_fallback.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/gpu_turn.rs (99%) rename bindings/rust/blenderui/tests/{ => suite}/headless.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/hooks.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/images.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/listener_bounds.rs (100%) create mode 100644 bindings/rust/blenderui/tests/suite/main.rs rename bindings/rust/blenderui/tests/{ => suite}/modern_css.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_builders.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_clip_move.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_derived.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_drag.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_hover_under.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_inview_scroll.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_layout.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_layout_parent.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_loop.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_presence.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_redraw.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_redraw_work.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_scroll.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_selector.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_stale.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/motion_widgets.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/option_child.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/option_props.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/pangui_layout.rs (99%) rename bindings/rust/blenderui/tests/{ => suite}/parity.rs (98%) rename bindings/rust/blenderui/tests/{ => suite}/perf_effects.rs (98%) rename bindings/rust/blenderui/tests/{ => suite}/render_target.rs (99%) rename bindings/rust/blenderui/tests/{ => suite}/rsx.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/screen.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/scroll_into_view.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/scroll_replace.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/selection.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/sound.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/struct_props.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/table.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/text_overflow.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/text_translate.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/textarea_grow.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/titlebar.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/vector_transforms.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/vlist.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/vlist_custom.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/widget_clip.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/widget_layers.rs (100%) rename bindings/rust/blenderui/tests/{ => suite}/widget_through.rs (100%) diff --git a/bindings/rust/Cargo.toml b/bindings/rust/Cargo.toml index 2d351370..1a86953c 100644 --- a/bindings/rust/Cargo.toml +++ b/bindings/rust/Cargo.toml @@ -12,6 +12,14 @@ homepage = "https://bui.preetham.top" authors = ["BUI contributors"] rust-version = "1.88" +# Each test and example links the whole kit: full debug info made each one's .pdb ~290 MB. +# Line tables keep file:line in backtraces and panics. +[profile.dev] +debug = "line-tables-only" + +[profile.dev.package."*"] +debug = false + # Shipped binaries (bindings/node/scripts/build.js: the Node addon and the # QuickJS runtime): whole-program LTO in one codegen unit. bui-runtime.exe # measured 7.56 MB with `release`, 7.09 MB with this (Windows, MSVC). diff --git a/bindings/rust/blenderui/tests/animation.rs b/bindings/rust/blenderui/tests/suite/animation.rs similarity index 100% rename from bindings/rust/blenderui/tests/animation.rs rename to bindings/rust/blenderui/tests/suite/animation.rs diff --git a/bindings/rust/blenderui/tests/app_root.rs b/bindings/rust/blenderui/tests/suite/app_root.rs similarity index 100% rename from bindings/rust/blenderui/tests/app_root.rs rename to bindings/rust/blenderui/tests/suite/app_root.rs diff --git a/bindings/rust/blenderui/tests/basic_css.rs b/bindings/rust/blenderui/tests/suite/basic_css.rs similarity index 100% rename from bindings/rust/blenderui/tests/basic_css.rs rename to bindings/rust/blenderui/tests/suite/basic_css.rs diff --git a/bindings/rust/blenderui/tests/common/mod.rs b/bindings/rust/blenderui/tests/suite/common.rs similarity index 100% rename from bindings/rust/blenderui/tests/common/mod.rs rename to bindings/rust/blenderui/tests/suite/common.rs diff --git a/bindings/rust/blenderui/tests/css_redraw.rs b/bindings/rust/blenderui/tests/suite/css_redraw.rs similarity index 100% rename from bindings/rust/blenderui/tests/css_redraw.rs rename to bindings/rust/blenderui/tests/suite/css_redraw.rs diff --git a/bindings/rust/blenderui/tests/damage_drag.rs b/bindings/rust/blenderui/tests/suite/damage_drag.rs similarity index 100% rename from bindings/rust/blenderui/tests/damage_drag.rs rename to bindings/rust/blenderui/tests/suite/damage_drag.rs diff --git a/bindings/rust/blenderui/tests/effects.rs b/bindings/rust/blenderui/tests/suite/effects.rs similarity index 100% rename from bindings/rust/blenderui/tests/effects.rs rename to bindings/rust/blenderui/tests/suite/effects.rs diff --git a/bindings/rust/blenderui/tests/features.rs b/bindings/rust/blenderui/tests/suite/features.rs similarity index 100% rename from bindings/rust/blenderui/tests/features.rs rename to bindings/rust/blenderui/tests/suite/features.rs diff --git a/bindings/rust/blenderui/tests/font_fallback.rs b/bindings/rust/blenderui/tests/suite/font_fallback.rs similarity index 100% rename from bindings/rust/blenderui/tests/font_fallback.rs rename to bindings/rust/blenderui/tests/suite/font_fallback.rs diff --git a/bindings/rust/blenderui/tests/gpu_turn.rs b/bindings/rust/blenderui/tests/suite/gpu_turn.rs similarity index 99% rename from bindings/rust/blenderui/tests/gpu_turn.rs rename to bindings/rust/blenderui/tests/suite/gpu_turn.rs index 421a9ca0..fd306893 100644 --- a/bindings/rust/blenderui/tests/gpu_turn.rs +++ b/bindings/rust/blenderui/tests/suite/gpu_turn.rs @@ -3,7 +3,7 @@ //! Needs a GPU (Direct3D 11 / OpenGL 3.3); without one the test has nothing //! to check and passes. -mod common; +use crate::common; use blenderui::effects::{transform, turn_box, turn_texture, Argb, Pixels, TURN_SHADER}; use blenderui::{GpuTarget, Image, ShaderEffect}; diff --git a/bindings/rust/blenderui/tests/headless.rs b/bindings/rust/blenderui/tests/suite/headless.rs similarity index 100% rename from bindings/rust/blenderui/tests/headless.rs rename to bindings/rust/blenderui/tests/suite/headless.rs diff --git a/bindings/rust/blenderui/tests/hooks.rs b/bindings/rust/blenderui/tests/suite/hooks.rs similarity index 100% rename from bindings/rust/blenderui/tests/hooks.rs rename to bindings/rust/blenderui/tests/suite/hooks.rs diff --git a/bindings/rust/blenderui/tests/images.rs b/bindings/rust/blenderui/tests/suite/images.rs similarity index 100% rename from bindings/rust/blenderui/tests/images.rs rename to bindings/rust/blenderui/tests/suite/images.rs diff --git a/bindings/rust/blenderui/tests/listener_bounds.rs b/bindings/rust/blenderui/tests/suite/listener_bounds.rs similarity index 100% rename from bindings/rust/blenderui/tests/listener_bounds.rs rename to bindings/rust/blenderui/tests/suite/listener_bounds.rs diff --git a/bindings/rust/blenderui/tests/suite/main.rs b/bindings/rust/blenderui/tests/suite/main.rs new file mode 100644 index 00000000..a31e1bd2 --- /dev/null +++ b/bindings/rust/blenderui/tests/suite/main.rs @@ -0,0 +1,61 @@ +//! The integration tests in one binary: each test file was its own executable, every one linking +//! the whole kit. Files that change or measure process-wide state (the theme, the UI scale, a +//! counting allocator) stay separate. + +mod common; +#[cfg(feature = "a11y")] +mod animation; +mod app_root; +mod basic_css; +mod css_redraw; +mod damage_drag; +mod effects; +mod features; +mod font_fallback; +mod gpu_turn; +mod headless; +mod hooks; +mod images; +mod listener_bounds; +mod modern_css; +mod motion; +mod motion_builders; +mod motion_clip_move; +mod motion_derived; +mod motion_drag; +mod motion_hover_under; +mod motion_inview_scroll; +mod motion_layout; +mod motion_layout_parent; +mod motion_loop; +mod motion_presence; +mod motion_redraw; +mod motion_redraw_work; +mod motion_scroll; +mod motion_selector; +mod motion_stale; +mod motion_widgets; +mod option_child; +mod option_props; +mod pangui_layout; +mod parity; +mod perf_effects; +mod render_target; +mod rsx; +mod screen; +mod scroll_into_view; +mod scroll_replace; +mod selection; +mod sound; +mod struct_props; +mod table; +mod text_overflow; +mod text_translate; +mod textarea_grow; +mod titlebar; +mod vector_transforms; +mod vlist; +mod vlist_custom; +mod widget_clip; +mod widget_layers; +mod widget_through; diff --git a/bindings/rust/blenderui/tests/modern_css.rs b/bindings/rust/blenderui/tests/suite/modern_css.rs similarity index 100% rename from bindings/rust/blenderui/tests/modern_css.rs rename to bindings/rust/blenderui/tests/suite/modern_css.rs diff --git a/bindings/rust/blenderui/tests/motion.rs b/bindings/rust/blenderui/tests/suite/motion.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion.rs rename to bindings/rust/blenderui/tests/suite/motion.rs diff --git a/bindings/rust/blenderui/tests/motion_builders.rs b/bindings/rust/blenderui/tests/suite/motion_builders.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_builders.rs rename to bindings/rust/blenderui/tests/suite/motion_builders.rs diff --git a/bindings/rust/blenderui/tests/motion_clip_move.rs b/bindings/rust/blenderui/tests/suite/motion_clip_move.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_clip_move.rs rename to bindings/rust/blenderui/tests/suite/motion_clip_move.rs diff --git a/bindings/rust/blenderui/tests/motion_derived.rs b/bindings/rust/blenderui/tests/suite/motion_derived.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_derived.rs rename to bindings/rust/blenderui/tests/suite/motion_derived.rs diff --git a/bindings/rust/blenderui/tests/motion_drag.rs b/bindings/rust/blenderui/tests/suite/motion_drag.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_drag.rs rename to bindings/rust/blenderui/tests/suite/motion_drag.rs diff --git a/bindings/rust/blenderui/tests/motion_hover_under.rs b/bindings/rust/blenderui/tests/suite/motion_hover_under.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_hover_under.rs rename to bindings/rust/blenderui/tests/suite/motion_hover_under.rs diff --git a/bindings/rust/blenderui/tests/motion_inview_scroll.rs b/bindings/rust/blenderui/tests/suite/motion_inview_scroll.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_inview_scroll.rs rename to bindings/rust/blenderui/tests/suite/motion_inview_scroll.rs diff --git a/bindings/rust/blenderui/tests/motion_layout.rs b/bindings/rust/blenderui/tests/suite/motion_layout.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_layout.rs rename to bindings/rust/blenderui/tests/suite/motion_layout.rs diff --git a/bindings/rust/blenderui/tests/motion_layout_parent.rs b/bindings/rust/blenderui/tests/suite/motion_layout_parent.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_layout_parent.rs rename to bindings/rust/blenderui/tests/suite/motion_layout_parent.rs diff --git a/bindings/rust/blenderui/tests/motion_loop.rs b/bindings/rust/blenderui/tests/suite/motion_loop.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_loop.rs rename to bindings/rust/blenderui/tests/suite/motion_loop.rs diff --git a/bindings/rust/blenderui/tests/motion_presence.rs b/bindings/rust/blenderui/tests/suite/motion_presence.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_presence.rs rename to bindings/rust/blenderui/tests/suite/motion_presence.rs diff --git a/bindings/rust/blenderui/tests/motion_redraw.rs b/bindings/rust/blenderui/tests/suite/motion_redraw.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_redraw.rs rename to bindings/rust/blenderui/tests/suite/motion_redraw.rs diff --git a/bindings/rust/blenderui/tests/motion_redraw_work.rs b/bindings/rust/blenderui/tests/suite/motion_redraw_work.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_redraw_work.rs rename to bindings/rust/blenderui/tests/suite/motion_redraw_work.rs diff --git a/bindings/rust/blenderui/tests/motion_scroll.rs b/bindings/rust/blenderui/tests/suite/motion_scroll.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_scroll.rs rename to bindings/rust/blenderui/tests/suite/motion_scroll.rs diff --git a/bindings/rust/blenderui/tests/motion_selector.rs b/bindings/rust/blenderui/tests/suite/motion_selector.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_selector.rs rename to bindings/rust/blenderui/tests/suite/motion_selector.rs diff --git a/bindings/rust/blenderui/tests/motion_stale.rs b/bindings/rust/blenderui/tests/suite/motion_stale.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_stale.rs rename to bindings/rust/blenderui/tests/suite/motion_stale.rs diff --git a/bindings/rust/blenderui/tests/motion_widgets.rs b/bindings/rust/blenderui/tests/suite/motion_widgets.rs similarity index 100% rename from bindings/rust/blenderui/tests/motion_widgets.rs rename to bindings/rust/blenderui/tests/suite/motion_widgets.rs diff --git a/bindings/rust/blenderui/tests/option_child.rs b/bindings/rust/blenderui/tests/suite/option_child.rs similarity index 100% rename from bindings/rust/blenderui/tests/option_child.rs rename to bindings/rust/blenderui/tests/suite/option_child.rs diff --git a/bindings/rust/blenderui/tests/option_props.rs b/bindings/rust/blenderui/tests/suite/option_props.rs similarity index 100% rename from bindings/rust/blenderui/tests/option_props.rs rename to bindings/rust/blenderui/tests/suite/option_props.rs diff --git a/bindings/rust/blenderui/tests/pangui_layout.rs b/bindings/rust/blenderui/tests/suite/pangui_layout.rs similarity index 99% rename from bindings/rust/blenderui/tests/pangui_layout.rs rename to bindings/rust/blenderui/tests/suite/pangui_layout.rs index 9138adaf..440fea87 100644 --- a/bindings/rust/blenderui/tests/pangui_layout.rs +++ b/bindings/rust/blenderui/tests/suite/pangui_layout.rs @@ -3,7 +3,7 @@ //! margin and gap, with `calc()`, `min()`, `max()` and `clamp()` as the custom //! math. Every test checks exact boxes against numbers worked out by hand (or by //! a small independent formula). `scene_timings` prints the layout time per node -//! for the same scenes: `cargo test --release --test pangui_layout -- --ignored --nocapture`. +//! for the same scenes: `cargo test --release --test suite pangui_layout:: -- --ignored --nocapture`. use blenderui::prelude::*; use std::time::Instant; diff --git a/bindings/rust/blenderui/tests/parity.rs b/bindings/rust/blenderui/tests/suite/parity.rs similarity index 98% rename from bindings/rust/blenderui/tests/parity.rs rename to bindings/rust/blenderui/tests/suite/parity.rs index 9e5af26b..873fe638 100644 --- a/bindings/rust/blenderui/tests/parity.rs +++ b/bindings/rust/blenderui/tests/suite/parity.rs @@ -1,5 +1,5 @@ //! Coverage of HTML elements and CSS properties (the numbers in the README). -//! `cargo test --test parity -- --nocapture` prints the report. +//! `cargo test --test suite parity:: -- --nocapture` prints the report. use blenderui::html::{tag_kind, TagKind, HTML_ELEMENT_COUNT, TAGS}; use blenderui::style::{implemented_properties, is_implemented, is_supported, ACCEPTED}; diff --git a/bindings/rust/blenderui/tests/perf_effects.rs b/bindings/rust/blenderui/tests/suite/perf_effects.rs similarity index 98% rename from bindings/rust/blenderui/tests/perf_effects.rs rename to bindings/rust/blenderui/tests/suite/perf_effects.rs index a935115d..ddab0ebc 100644 --- a/bindings/rust/blenderui/tests/perf_effects.rs +++ b/bindings/rust/blenderui/tests/suite/perf_effects.rs @@ -2,7 +2,7 @@ //! long song's lyrics (300 lines of text): CSS transitions, animated scale on //! text, blur (still, moving, animated, a wide backdrop). Headless, so drawn //! by the software rasterizer. Run in release: -//! `cargo test --release --test perf_effects -- --ignored --nocapture --test-threads=1` +//! `cargo test --release --test suite perf_effects:: -- --ignored --nocapture --test-threads=1` use std::fmt::Write as _; use std::time::{Duration, Instant}; diff --git a/bindings/rust/blenderui/tests/render_target.rs b/bindings/rust/blenderui/tests/suite/render_target.rs similarity index 99% rename from bindings/rust/blenderui/tests/render_target.rs rename to bindings/rust/blenderui/tests/suite/render_target.rs index 5607e861..e12ff850 100644 --- a/bindings/rust/blenderui/tests/render_target.rs +++ b/bindings/rust/blenderui/tests/suite/render_target.rs @@ -1,7 +1,7 @@ //! Render targets: effects that draw into textures, with feedback. Needs a GPU device (Direct3D 11 or //! OpenGL 3.3); without one each test says so and passes. -mod common; +use crate::common; use blenderui::{GpuTarget, RenderTarget, ShaderEffect, TargetFormat}; use common::gpu_lock; diff --git a/bindings/rust/blenderui/tests/rsx.rs b/bindings/rust/blenderui/tests/suite/rsx.rs similarity index 100% rename from bindings/rust/blenderui/tests/rsx.rs rename to bindings/rust/blenderui/tests/suite/rsx.rs diff --git a/bindings/rust/blenderui/tests/screen.rs b/bindings/rust/blenderui/tests/suite/screen.rs similarity index 100% rename from bindings/rust/blenderui/tests/screen.rs rename to bindings/rust/blenderui/tests/suite/screen.rs diff --git a/bindings/rust/blenderui/tests/scroll_into_view.rs b/bindings/rust/blenderui/tests/suite/scroll_into_view.rs similarity index 100% rename from bindings/rust/blenderui/tests/scroll_into_view.rs rename to bindings/rust/blenderui/tests/suite/scroll_into_view.rs diff --git a/bindings/rust/blenderui/tests/scroll_replace.rs b/bindings/rust/blenderui/tests/suite/scroll_replace.rs similarity index 100% rename from bindings/rust/blenderui/tests/scroll_replace.rs rename to bindings/rust/blenderui/tests/suite/scroll_replace.rs diff --git a/bindings/rust/blenderui/tests/selection.rs b/bindings/rust/blenderui/tests/suite/selection.rs similarity index 100% rename from bindings/rust/blenderui/tests/selection.rs rename to bindings/rust/blenderui/tests/suite/selection.rs diff --git a/bindings/rust/blenderui/tests/sound.rs b/bindings/rust/blenderui/tests/suite/sound.rs similarity index 100% rename from bindings/rust/blenderui/tests/sound.rs rename to bindings/rust/blenderui/tests/suite/sound.rs diff --git a/bindings/rust/blenderui/tests/struct_props.rs b/bindings/rust/blenderui/tests/suite/struct_props.rs similarity index 100% rename from bindings/rust/blenderui/tests/struct_props.rs rename to bindings/rust/blenderui/tests/suite/struct_props.rs diff --git a/bindings/rust/blenderui/tests/table.rs b/bindings/rust/blenderui/tests/suite/table.rs similarity index 100% rename from bindings/rust/blenderui/tests/table.rs rename to bindings/rust/blenderui/tests/suite/table.rs diff --git a/bindings/rust/blenderui/tests/text_overflow.rs b/bindings/rust/blenderui/tests/suite/text_overflow.rs similarity index 100% rename from bindings/rust/blenderui/tests/text_overflow.rs rename to bindings/rust/blenderui/tests/suite/text_overflow.rs diff --git a/bindings/rust/blenderui/tests/text_translate.rs b/bindings/rust/blenderui/tests/suite/text_translate.rs similarity index 100% rename from bindings/rust/blenderui/tests/text_translate.rs rename to bindings/rust/blenderui/tests/suite/text_translate.rs diff --git a/bindings/rust/blenderui/tests/textarea_grow.rs b/bindings/rust/blenderui/tests/suite/textarea_grow.rs similarity index 100% rename from bindings/rust/blenderui/tests/textarea_grow.rs rename to bindings/rust/blenderui/tests/suite/textarea_grow.rs diff --git a/bindings/rust/blenderui/tests/titlebar.rs b/bindings/rust/blenderui/tests/suite/titlebar.rs similarity index 100% rename from bindings/rust/blenderui/tests/titlebar.rs rename to bindings/rust/blenderui/tests/suite/titlebar.rs diff --git a/bindings/rust/blenderui/tests/vector_transforms.rs b/bindings/rust/blenderui/tests/suite/vector_transforms.rs similarity index 100% rename from bindings/rust/blenderui/tests/vector_transforms.rs rename to bindings/rust/blenderui/tests/suite/vector_transforms.rs diff --git a/bindings/rust/blenderui/tests/vlist.rs b/bindings/rust/blenderui/tests/suite/vlist.rs similarity index 100% rename from bindings/rust/blenderui/tests/vlist.rs rename to bindings/rust/blenderui/tests/suite/vlist.rs diff --git a/bindings/rust/blenderui/tests/vlist_custom.rs b/bindings/rust/blenderui/tests/suite/vlist_custom.rs similarity index 100% rename from bindings/rust/blenderui/tests/vlist_custom.rs rename to bindings/rust/blenderui/tests/suite/vlist_custom.rs diff --git a/bindings/rust/blenderui/tests/widget_clip.rs b/bindings/rust/blenderui/tests/suite/widget_clip.rs similarity index 100% rename from bindings/rust/blenderui/tests/widget_clip.rs rename to bindings/rust/blenderui/tests/suite/widget_clip.rs diff --git a/bindings/rust/blenderui/tests/widget_layers.rs b/bindings/rust/blenderui/tests/suite/widget_layers.rs similarity index 100% rename from bindings/rust/blenderui/tests/widget_layers.rs rename to bindings/rust/blenderui/tests/suite/widget_layers.rs diff --git a/bindings/rust/blenderui/tests/widget_through.rs b/bindings/rust/blenderui/tests/suite/widget_through.rs similarity index 100% rename from bindings/rust/blenderui/tests/widget_through.rs rename to bindings/rust/blenderui/tests/suite/widget_through.rs diff --git a/docs/effects-performance.md b/docs/effects-performance.md index 6ec0ddef..bcc469d6 100644 --- a/docs/effects-performance.md +++ b/docs/effects-performance.md @@ -13,8 +13,8 @@ per frame. ## What it costs now -`cargo test --release --test perf_effects -- --ignored --nocapture --test-threads=1` -(`bindings/rust/blenderui/tests/perf_effects.rs`): a 1280×800 headless window, +`cargo test --release --test suite perf_effects:: -- --ignored --nocapture --test-threads=1` +(`bindings/rust/blenderui/tests/suite/perf_effects.rs`): a 1280×800 headless window, 300 rows of text, 60 frames of 16 ms each. | Scene | First frame | BUI per frame (mean / worst) | diff --git a/docs/rust.md b/docs/rust.md index 1379146c..45e1c24e 100644 --- a/docs/rust.md +++ b/docs/rust.md @@ -471,7 +471,7 @@ autoscroll. On the `Window` (listeners get it): `selected_text() -> Option`, `select_all()`, `clear_selection()`, `on_selection_change(|text, window, app| ..)` (fires for the user's changes) and `read_clipboard()` / `write_clipboard(text)`. -`examples/selectable.rs` is a page of paragraphs; `tests/selection.rs` drives it +`examples/selectable.rs` is a page of paragraphs; `tests/suite/selection.rs` drives it headlessly with `simulate_drag`, `simulate_click` and `simulate_key_with`. ## Screens, areas and regions @@ -589,7 +589,7 @@ let chat = cx.new(|cx| ListState::new(ChatList::from_messages(synth::messages(0, // elsewhere: chat.update(cx, |s, _| s.push(message)); // follows while at the bottom ``` -For items that are not messages, build a `List` from your own `ItemSource`, `Measurer` and `ItemPainter` and show it with `variable_list(&state)`. A `Record` carries an `id`, `time` and `sender` values and `flags` bits (`FLAG_PLACEHOLDER` is the engine's, `FLAG_USER << n` is free), `text`, an image and opaque `data` bytes your look decodes (stored in the page's buffer, no allocation per item); `ItemPainter::hit` returns an item-local part id for a press, delivered by `VariableList::on_item_hit(|item, part, list| ..)` next to `on_item_click`; `on_item_hover(|item, list| ..)` reports the item under the pointer (`None` off it) and only repaints, and `on_copy(|state| ..)` returns the text Ctrl+C copies; `Measurer::estimator` has a default. Everything a look needs (`PaintSink`, `Palette`, `Rect`, `Rgba`, `Lines`, `Record`, ...) is re-exported from `blenderui::vlist`. Items are painted, not elements: no buttons or text fields inside an item. `examples/vlist_cards.rs` is a non-chat feed of task cards and `tests/vlist_custom.rs` runs a custom look headlessly. `bindings/rust/blenderui-vlist-gpui` is the same list for real gpui (outside the main workspace); its benchmark against gpui's `list` and gpui-component's `virtual_list` is in `bench/`. Measured numbers and the method are on the website page "Variable-height lists". Not built yet: selecting text across messages, a background measuring thread, damage regions, JavaScript and Python wrappers. +For items that are not messages, build a `List` from your own `ItemSource`, `Measurer` and `ItemPainter` and show it with `variable_list(&state)`. A `Record` carries an `id`, `time` and `sender` values and `flags` bits (`FLAG_PLACEHOLDER` is the engine's, `FLAG_USER << n` is free), `text`, an image and opaque `data` bytes your look decodes (stored in the page's buffer, no allocation per item); `ItemPainter::hit` returns an item-local part id for a press, delivered by `VariableList::on_item_hit(|item, part, list| ..)` next to `on_item_click`; `on_item_hover(|item, list| ..)` reports the item under the pointer (`None` off it) and only repaints, and `on_copy(|state| ..)` returns the text Ctrl+C copies; `Measurer::estimator` has a default. Everything a look needs (`PaintSink`, `Palette`, `Rect`, `Rgba`, `Lines`, `Record`, ...) is re-exported from `blenderui::vlist`. Items are painted, not elements: no buttons or text fields inside an item. `examples/vlist_cards.rs` is a non-chat feed of task cards and `tests/suite/vlist_custom.rs` runs a custom look headlessly. `bindings/rust/blenderui-vlist-gpui` is the same list for real gpui (outside the main workspace); its benchmark against gpui's `list` and gpui-component's `virtual_list` is in `bench/`. Measured numbers and the method are on the website page "Variable-height lists". Not built yet: selecting text across messages, a background measuring thread, damage regions, JavaScript and Python wrappers. `blenderui::shadcn` also has `VirtualList` (`count` and an `item` closure that writes each item's text, so ten million rows cost a screenful) and `ChatList`, with TanStack Virtual's names: `estimate_size`, `overscan`, `get_item_key`, `on_range_change`, and `scroll_to_index` / `scroll_to_offset` / `measure_element` on the `ListHandle` that `use_virtual_list()` returns. They sit on `ListState` and `ItemSource` (the new `CountSource` and `RowStyle` in `blenderui-vlist`), so the file-backed source works under them. See the website page "Virtual list API" and `examples/site_shadcn_list.rs`. @@ -615,7 +615,7 @@ The kit has global state, so one `Application` runs at a time per process ## Coverage -From `cargo test --test parity -- --nocapture`: +From `cargo test --test suite parity:: -- --nocapture`: | Area | Coverage | | ------------------------------------- | -------------------------------------------------------------------------------- | diff --git a/website/src/content/docs/concepts/screens.mdx b/website/src/content/docs/concepts/screens.mdx index 0d31b4b9..44451494 100644 --- a/website/src/content/docs/concepts/screens.mdx +++ b/website/src/content/docs/concepts/screens.mdx @@ -3,7 +3,7 @@ title: Screens, areas and regions description: Blender's resizable, splittable, dockable editor layout in every language. Drag the edges between areas, drag a corner to split, join or dock, maximize with Ctrl+Space; regions (headers, toolbars, sidebars) resize, hide and flip; panels reorder and pin. Ported from Blender's editors/screen. section: Concepts order: 68 -sources: ["kit/intern/screen/screen_intern.h", "kit/intern/screen/screen_geometry.c", "kit/intern/screen/screen_edit.c", "kit/intern/screen/area.c", "kit/intern/screen/screen_ops.c", "kit/intern/screen/screen_draw.c", "kit/intern/screen/screen_layout.c", "kit/intern/screen/screen_node.c", "kit/include/BUI_kit.h", "bindings/python/bui/components/screen.py", "bindings/python/bui/qtcontainers.py", "bindings/python/bui/tksyntax/_widgets.py", "bindings/lua/src/bui_node.c", "bindings/d/source/bui/node.d", "tests/screen_test.c", "bindings/python/tests/test_screen.py", "bindings/lua/tests/test_screen.lua", "bindings/rust/blenderui/src/screen.rs", "bindings/rust/blenderui/tests/screen.rs", "bindings/node/screen.js", "bindings/react/index.js"] +sources: ["kit/intern/screen/screen_intern.h", "kit/intern/screen/screen_geometry.c", "kit/intern/screen/screen_edit.c", "kit/intern/screen/area.c", "kit/intern/screen/screen_ops.c", "kit/intern/screen/screen_draw.c", "kit/intern/screen/screen_layout.c", "kit/intern/screen/screen_node.c", "kit/include/BUI_kit.h", "bindings/python/bui/components/screen.py", "bindings/python/bui/qtcontainers.py", "bindings/python/bui/tksyntax/_widgets.py", "bindings/lua/src/bui_node.c", "bindings/d/source/bui/node.d", "tests/screen_test.c", "bindings/python/tests/test_screen.py", "bindings/lua/tests/test_screen.lua", "bindings/rust/blenderui/src/screen.rs", "bindings/rust/blenderui/tests/suite/screen.rs", "bindings/node/screen.js", "bindings/react/index.js"] --- Blender's window is a **screen** of **areas**, each showing one editor, and each area is made of **regions**: a header, a toolbar, a sidebar, the main view. BUI has the same thing, ported from Blender's `editors/screen` (`screen_geometry.cc`, `screen_edit.cc`, `area.cc`, `screen_ops.cc`, `screen_draw.cc`), so it behaves like Blender in every language. diff --git a/website/src/content/docs/reference/binary-size.mdx b/website/src/content/docs/reference/binary-size.mdx index bb20d8c3..8931f20a 100644 --- a/website/src/content/docs/reference/binary-size.mdx +++ b/website/src/content/docs/reference/binary-size.mdx @@ -4,7 +4,7 @@ description: Pay only for what you use. One feature table turns BUI's optional p section: Reference order: 22 languages: ["c", "rust", "javascript", "python"] -sources: ["features.json", "features.cmake", "kit/CMakeLists.txt", "gpu/CMakeLists.txt", "bindings/rust/blenderui-sys/build.rs", "bindings/rust/blenderui-sys/Cargo.toml", "bindings/rust/blenderui/Cargo.toml", "bindings/rust/blenderui/tests/features.rs", "bindings/node/features.js", "bindings/node/cli.js", "bindings/node/scripts/build.js", "bindings/node/bench/size/hello.jsx"] +sources: ["features.json", "features.cmake", "kit/CMakeLists.txt", "gpu/CMakeLists.txt", "bindings/rust/blenderui-sys/build.rs", "bindings/rust/blenderui-sys/Cargo.toml", "bindings/rust/blenderui/Cargo.toml", "bindings/rust/blenderui/tests/suite/features.rs", "bindings/node/features.js", "bindings/node/cli.js", "bindings/node/scripts/build.js", "bindings/node/bench/size/hello.jsx"] --- A feature should cost binary size only if you use it. BUI's optional parts are one table, [`features.json`](https://github.com/ppmpreetham/BUI/blob/main/features.json), and three tools read it: diff --git a/website/src/content/docs/reference/coverage.mdx b/website/src/content/docs/reference/coverage.mdx index 8aa59ddf..b6f9211b 100644 --- a/website/src/content/docs/reference/coverage.mdx +++ b/website/src/content/docs/reference/coverage.mdx @@ -56,7 +56,7 @@ The plan is to measure against PySide6 itself, run the same programs on real Qt ## HTML and CSS (Rust and JavaScript) -Counted by `cargo test --test parity -- --nocapture` in `bindings/rust`. +Counted by `cargo test --test suite parity:: -- --nocapture` in `bindings/rust`. | Area | Coverage | | --- | --- | diff --git a/website/src/content/docs/rust/css-and-tailwind.mdx b/website/src/content/docs/rust/css-and-tailwind.mdx index 1b192d25..7ca61128 100644 --- a/website/src/content/docs/rust/css-and-tailwind.mdx +++ b/website/src/content/docs/rust/css-and-tailwind.mdx @@ -4,7 +4,7 @@ description: Style Rust UIs with typed methods, compile-checked CSS, stylesheets section: Rust order: 40 languages: ["rust"] -sources: ["docs/rust.md", "bindings/rust/blenderui/src/style.rs", "bindings/rust/blenderui/src/styled.rs", "bindings/rust/blenderui/src/color.rs", "bindings/rust/blenderui/src/lib.rs", "bindings/rust/blenderui-macros/src/lib.rs", "bindings/rust/blenderui-macros/src/rsx.rs", "bindings/rust/blenderui-tailwind/src/lib.rs", "bindings/rust/blenderui/tests/modern_css.rs", "bindings/rust/blenderui/tests/rsx.rs", "bindings/rust/blenderui/tests/parity.rs", "CHANGELOG.md"] +sources: ["docs/rust.md", "bindings/rust/blenderui/src/style.rs", "bindings/rust/blenderui/src/styled.rs", "bindings/rust/blenderui/src/color.rs", "bindings/rust/blenderui/src/lib.rs", "bindings/rust/blenderui-macros/src/lib.rs", "bindings/rust/blenderui-macros/src/rsx.rs", "bindings/rust/blenderui-tailwind/src/lib.rs", "bindings/rust/blenderui/tests/suite/modern_css.rs", "bindings/rust/blenderui/tests/suite/rsx.rs", "bindings/rust/blenderui/tests/suite/parity.rs", "CHANGELOG.md"] --- Whatever way you like to style, it works here. Chain typed methods, write a CSS block, drop in a `