diff --git a/crates/bevy_color/src/hsla.rs b/crates/bevy_color/src/hsla.rs index ac7cdf93da..3c225b369d 100644 --- a/crates/bevy_color/src/hsla.rs +++ b/crates/bevy_color/src/hsla.rs @@ -304,7 +304,6 @@ mod tests { use super::*; use crate::{ color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq, - Srgba, }; #[test] diff --git a/crates/bevy_color/src/hsva.rs b/crates/bevy_color/src/hsva.rs index 014b447cba..f58cdefac5 100644 --- a/crates/bevy_color/src/hsva.rs +++ b/crates/bevy_color/src/hsva.rs @@ -227,7 +227,6 @@ mod tests { use super::*; use crate::{ color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq, - Srgba, }; #[test] diff --git a/crates/bevy_color/src/hwba.rs b/crates/bevy_color/src/hwba.rs index 41b4bd06be..f5e7cf3a93 100644 --- a/crates/bevy_color/src/hwba.rs +++ b/crates/bevy_color/src/hwba.rs @@ -260,7 +260,6 @@ mod tests { use super::*; use crate::{ color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq, - Srgba, }; #[test] diff --git a/crates/bevy_color/src/laba.rs b/crates/bevy_color/src/laba.rs index 5c95472932..2ce9b55b72 100644 --- a/crates/bevy_color/src/laba.rs +++ b/crates/bevy_color/src/laba.rs @@ -320,7 +320,6 @@ mod tests { use super::*; use crate::{ color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq, - Srgba, }; #[test] diff --git a/crates/bevy_color/src/lcha.rs b/crates/bevy_color/src/lcha.rs index 75051a3ffe..b33236d6f1 100644 --- a/crates/bevy_color/src/lcha.rs +++ b/crates/bevy_color/src/lcha.rs @@ -289,7 +289,6 @@ mod tests { use super::*; use crate::{ color_difference::EuclideanDistance, test_colors::TEST_COLORS, testing::assert_approx_eq, - Srgba, }; #[test] diff --git a/crates/bevy_color/src/oklaba.rs b/crates/bevy_color/src/oklaba.rs index 65cd88f775..858091a719 100644 --- a/crates/bevy_color/src/oklaba.rs +++ b/crates/bevy_color/src/oklaba.rs @@ -305,7 +305,7 @@ impl From for Xyza { #[cfg(test)] mod tests { use super::*; - use crate::{test_colors::TEST_COLORS, testing::assert_approx_eq, Srgba}; + use crate::{test_colors::TEST_COLORS, testing::assert_approx_eq}; #[test] fn test_to_from_srgba() { diff --git a/crates/bevy_color/src/oklcha.rs b/crates/bevy_color/src/oklcha.rs index 949b80eb08..01b21b6780 100644 --- a/crates/bevy_color/src/oklcha.rs +++ b/crates/bevy_color/src/oklcha.rs @@ -344,7 +344,7 @@ impl From for Xyza { #[cfg(test)] mod tests { use super::*; - use crate::{test_colors::TEST_COLORS, testing::assert_approx_eq, Srgba}; + use crate::{test_colors::TEST_COLORS, testing::assert_approx_eq}; #[test] fn test_to_from_srgba() { diff --git a/crates/bevy_ecs/src/entity/hash.rs b/crates/bevy_ecs/src/entity/hash.rs index b3de84e52d..fac4ad12d8 100644 --- a/crates/bevy_ecs/src/entity/hash.rs +++ b/crates/bevy_ecs/src/entity/hash.rs @@ -87,8 +87,6 @@ pub type EntityHashSet = hashbrown::HashSet; #[cfg(test)] mod tests { use super::*; - #[cfg(feature = "bevy_reflect")] - use bevy_reflect::Reflect; use static_assertions::assert_impl_all; // Check that the HashMaps are Clone if the key/values are Clone diff --git a/crates/bevy_ecs/src/query/builder.rs b/crates/bevy_ecs/src/query/builder.rs index b19c5a6b51..101371d004 100644 --- a/crates/bevy_ecs/src/query/builder.rs +++ b/crates/bevy_ecs/src/query/builder.rs @@ -253,8 +253,6 @@ mod tests { use crate::prelude::*; use crate::world::FilteredEntityRef; - use super::QueryBuilder; - #[derive(Component, PartialEq, Debug)] struct A(usize); diff --git a/crates/bevy_ecs/src/schedule/condition.rs b/crates/bevy_ecs/src/schedule/condition.rs index 1be8e4b7ed..95e2442e27 100644 --- a/crates/bevy_ecs/src/schedule/condition.rs +++ b/crates/bevy_ecs/src/schedule/condition.rs @@ -1032,7 +1032,7 @@ mod tests { use crate as bevy_ecs; use crate::component::Component; use crate::schedule::IntoSystemConfigs; - use crate::schedule::{common_conditions::not, State, States}; + use crate::schedule::{State, States}; use crate::system::Local; use crate::{change_detection::ResMut, schedule::Schedule, world::World}; use bevy_ecs_macros::Event; diff --git a/crates/bevy_ecs/src/schedule/mod.rs b/crates/bevy_ecs/src/schedule/mod.rs index 8ac9a9d47b..b38f7adb67 100644 --- a/crates/bevy_ecs/src/schedule/mod.rs +++ b/crates/bevy_ecs/src/schedule/mod.rs @@ -26,7 +26,7 @@ mod tests { use std::sync::atomic::{AtomicU32, Ordering}; pub use crate as bevy_ecs; - pub use crate::schedule::{IntoSystemSetConfigs, Schedule, SystemSet}; + pub use crate::schedule::{Schedule, SystemSet}; pub use crate::system::{Res, ResMut}; pub use crate::{prelude::World, system::Resource}; @@ -724,7 +724,6 @@ mod tests { use super::*; // Required to make the derive macro behave use crate as bevy_ecs; - use crate::event::Events; use crate::prelude::*; #[derive(Resource)] diff --git a/crates/bevy_ecs/src/schedule/stepping.rs b/crates/bevy_ecs/src/schedule/stepping.rs index eb8b4699eb..a129993e89 100644 --- a/crates/bevy_ecs/src/schedule/stepping.rs +++ b/crates/bevy_ecs/src/schedule/stepping.rs @@ -828,7 +828,7 @@ impl ScheduleState { mod tests { use super::*; use crate::prelude::*; - use crate::{schedule::ScheduleLabel, world::World}; + use crate::schedule::ScheduleLabel; pub use crate as bevy_ecs; diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index eabe8d5d19..5d63b310a5 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -1531,9 +1531,9 @@ mod tests { use super::*; use crate::{ self as bevy_ecs, // Necessary for the `SystemParam` Derive when used inside `bevy_ecs`. - system::{assert_is_system, Query}, + system::assert_is_system, }; - use std::{cell::RefCell, marker::PhantomData}; + use std::cell::RefCell; // Compile test for https://github.com/bevyengine/bevy/pull/2838. #[test] diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs index 150a9105b8..9b2470890b 100644 --- a/crates/bevy_math/src/direction.rs +++ b/crates/bevy_math/src/direction.rs @@ -564,7 +564,6 @@ impl approx::UlpsEq for Dir3A { #[cfg(test)] mod tests { use super::*; - use crate::InvalidDirectionError; #[test] fn dir2_creation() { diff --git a/crates/bevy_math/src/primitives/dim3.rs b/crates/bevy_math/src/primitives/dim3.rs index a469fa7efb..47d83b8b5e 100644 --- a/crates/bevy_math/src/primitives/dim3.rs +++ b/crates/bevy_math/src/primitives/dim3.rs @@ -828,7 +828,6 @@ mod tests { // Reference values were computed by hand and/or with external tools use super::*; - use crate::{InvalidDirectionError, Quat}; use approx::assert_relative_eq; #[test] diff --git a/crates/bevy_reflect/src/path/mod.rs b/crates/bevy_reflect/src/path/mod.rs index a1d92732ae..fdf1c5d9d5 100644 --- a/crates/bevy_reflect/src/path/mod.rs +++ b/crates/bevy_reflect/src/path/mod.rs @@ -491,7 +491,6 @@ mod tests { use super::*; use crate as bevy_reflect; use crate::*; - use error::AccessErrorKind; #[derive(Reflect)] struct A { diff --git a/crates/bevy_render/src/texture/image.rs b/crates/bevy_render/src/texture/image.rs index d163841837..4b8a5d71ce 100644 --- a/crates/bevy_render/src/texture/image.rs +++ b/crates/bevy_render/src/texture/image.rs @@ -937,7 +937,6 @@ impl CompressedImageFormats { #[cfg(test)] mod test { use super::*; - use crate::render_asset::RenderAssetUsages; #[test] fn image_size() { diff --git a/crates/bevy_render/src/texture/image_texture_conversion.rs b/crates/bevy_render/src/texture/image_texture_conversion.rs index d5bbed5ee6..5284c0adcc 100644 --- a/crates/bevy_render/src/texture/image_texture_conversion.rs +++ b/crates/bevy_render/src/texture/image_texture_conversion.rs @@ -222,7 +222,6 @@ mod test { use image::{GenericImage, Rgba}; use super::*; - use crate::render_asset::RenderAssetUsages; #[test] fn two_way_conversion() { diff --git a/crates/bevy_time/src/common_conditions.rs b/crates/bevy_time/src/common_conditions.rs index a175e4632a..760ddf84ff 100644 --- a/crates/bevy_time/src/common_conditions.rs +++ b/crates/bevy_time/src/common_conditions.rs @@ -239,7 +239,6 @@ pub fn paused(time: Res>) -> bool { mod tests { use super::*; use bevy_ecs::schedule::{IntoSystemConfigs, Schedule}; - use std::time::Duration; fn test_system() {} diff --git a/crates/bevy_transform/src/systems.rs b/crates/bevy_transform/src/systems.rs index 12e44b193b..401a32cb22 100644 --- a/crates/bevy_transform/src/systems.rs +++ b/crates/bevy_transform/src/systems.rs @@ -188,10 +188,9 @@ mod test { use bevy_math::{vec3, Vec3}; use bevy_tasks::{ComputeTaskPool, TaskPool}; - use crate::components::{GlobalTransform, Transform}; use crate::systems::*; use crate::TransformBundle; - use bevy_hierarchy::{BuildChildren, BuildWorldChildren, Children, Parent}; + use bevy_hierarchy::{BuildChildren, BuildWorldChildren}; #[test] fn correct_parent_removed() { diff --git a/examples/3d/3d_viewport_to_world.rs b/examples/3d/3d_viewport_to_world.rs index dafcd9765d..8a3aed6e5b 100644 --- a/examples/3d/3d_viewport_to_world.rs +++ b/examples/3d/3d_viewport_to_world.rs @@ -1,6 +1,6 @@ //! This example demonstrates how to use the `Camera::viewport_to_world` method. -use bevy::{math::Dir3, prelude::*}; +use bevy::prelude::*; fn main() { App::new() diff --git a/examples/3d/shadow_caster_receiver.rs b/examples/3d/shadow_caster_receiver.rs index 97426737d9..f19adf15e0 100644 --- a/examples/3d/shadow_caster_receiver.rs +++ b/examples/3d/shadow_caster_receiver.rs @@ -4,7 +4,7 @@ use std::f32::consts::PI; use bevy::{ color::palettes::basic::{BLUE, LIME, RED}, - pbr::{light_consts, CascadeShadowConfigBuilder, NotShadowCaster, NotShadowReceiver}, + pbr::{CascadeShadowConfigBuilder, NotShadowCaster, NotShadowReceiver}, prelude::*, }; diff --git a/examples/animation/cubic_curve.rs b/examples/animation/cubic_curve.rs index 80035d574e..ce7a6da198 100644 --- a/examples/animation/cubic_curve.rs +++ b/examples/animation/cubic_curve.rs @@ -2,7 +2,7 @@ use bevy::{ color::palettes::css::{ORANGE, SILVER, WHITE}, - math::{cubic_splines::CubicCurve, vec3}, + math::vec3, prelude::*, }; diff --git a/examples/animation/custom_skinned_mesh.rs b/examples/animation/custom_skinned_mesh.rs index cc41ef6a63..8c37e3b956 100644 --- a/examples/animation/custom_skinned_mesh.rs +++ b/examples/animation/custom_skinned_mesh.rs @@ -4,7 +4,6 @@ use std::f32::consts::*; use bevy::{ - pbr::AmbientLight, prelude::*, render::{ mesh::{ diff --git a/examples/animation/gltf_skinned_mesh.rs b/examples/animation/gltf_skinned_mesh.rs index ae245ffdad..b7ae027821 100644 --- a/examples/animation/gltf_skinned_mesh.rs +++ b/examples/animation/gltf_skinned_mesh.rs @@ -3,7 +3,7 @@ use std::f32::consts::*; -use bevy::{pbr::AmbientLight, prelude::*, render::mesh::skinning::SkinnedMesh}; +use bevy::{prelude::*, render::mesh::skinning::SkinnedMesh}; fn main() { App::new() diff --git a/examples/app/return_after_run.rs b/examples/app/return_after_run.rs index 0c3493f6b1..52d162af16 100644 --- a/examples/app/return_after_run.rs +++ b/examples/app/return_after_run.rs @@ -5,7 +5,7 @@ //! - `App::run()` will never return on iOS and Web. //! - It is not possible to recreate a window after the event loop has been terminated. -use bevy::{prelude::*, window::WindowPlugin}; +use bevy::prelude::*; fn main() { println!("Running Bevy App"); diff --git a/examples/asset/custom_asset.rs b/examples/asset/custom_asset.rs index b3167bbd1d..e414f0ff63 100644 --- a/examples/asset/custom_asset.rs +++ b/examples/asset/custom_asset.rs @@ -1,7 +1,7 @@ //! Implements loader for a custom asset type. use bevy::{ - asset::{io::Reader, ron, AssetLoader, AsyncReadExt, LoadContext}, + asset::{io::Reader, AssetLoader, AsyncReadExt, LoadContext}, prelude::*, reflect::TypePath, }; diff --git a/examples/ecs/component_change_detection.rs b/examples/ecs/component_change_detection.rs index 234a7021e9..096fb4a9fe 100644 --- a/examples/ecs/component_change_detection.rs +++ b/examples/ecs/component_change_detection.rs @@ -1,6 +1,6 @@ //! This example illustrates how to react to component change. -use bevy::{ecs::world::Ref, prelude::*}; +use bevy::prelude::*; use rand::Rng; fn main() { diff --git a/examples/ecs/dynamic.rs b/examples/ecs/dynamic.rs index d5f18e059c..c804062aef 100644 --- a/examples/ecs/dynamic.rs +++ b/examples/ecs/dynamic.rs @@ -9,7 +9,7 @@ use bevy::prelude::*; use bevy::{ ecs::{ component::{ComponentDescriptor, ComponentId, ComponentInfo, StorageType}, - query::{QueryBuilder, QueryData}, + query::QueryData, world::FilteredEntityMut, }, ptr::{Aligned, OwningPtr}, diff --git a/examples/gizmos/light_gizmos.rs b/examples/gizmos/light_gizmos.rs index e06b6c0e8d..e8f2bf4ec6 100644 --- a/examples/gizmos/light_gizmos.rs +++ b/examples/gizmos/light_gizmos.rs @@ -4,7 +4,6 @@ use std::f32::consts::{FRAC_PI_2, PI}; use bevy::{ color::palettes::css::{DARK_CYAN, GOLD, GRAY, PURPLE}, - gizmos::light::{LightGizmoColor, LightGizmoConfigGroup}, prelude::*, }; diff --git a/examples/input/char_input_events.rs b/examples/input/char_input_events.rs index bdaefb7233..f2e52dd733 100644 --- a/examples/input/char_input_events.rs +++ b/examples/input/char_input_events.rs @@ -1,6 +1,6 @@ //! Prints out all chars as they are inputted. -use bevy::{prelude::*, window::ReceivedCharacter}; +use bevy::prelude::*; fn main() { App::new() diff --git a/examples/input/gamepad_input.rs b/examples/input/gamepad_input.rs index 13796c59fa..e07b43a5c2 100644 --- a/examples/input/gamepad_input.rs +++ b/examples/input/gamepad_input.rs @@ -1,6 +1,6 @@ //! Shows handling of gamepad input, connections, and disconnections. -use bevy::{input::gamepad::GamepadButton, prelude::*}; +use bevy::prelude::*; fn main() { App::new() diff --git a/examples/shader/compute_shader_game_of_life.rs b/examples/shader/compute_shader_game_of_life.rs index 21b5cc92c4..43f8a0b448 100644 --- a/examples/shader/compute_shader_game_of_life.rs +++ b/examples/shader/compute_shader_game_of_life.rs @@ -14,7 +14,6 @@ use bevy::{ renderer::{RenderContext, RenderDevice}, Render, RenderApp, RenderSet, }, - window::WindowPlugin, }; use std::borrow::Cow; diff --git a/examples/stress_tests/many_animated_sprites.rs b/examples/stress_tests/many_animated_sprites.rs index 91f2e122d5..17be46f0ac 100644 --- a/examples/stress_tests/many_animated_sprites.rs +++ b/examples/stress_tests/many_animated_sprites.rs @@ -7,9 +7,7 @@ use std::time::Duration; use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, - math::Quat, prelude::*, - render::camera::Camera, window::{PresentMode, WindowResolution}, winit::{UpdateMode, WinitSettings}, }; diff --git a/examples/stress_tests/many_buttons.rs b/examples/stress_tests/many_buttons.rs index ae4d8c47e0..03fad2bc86 100644 --- a/examples/stress_tests/many_buttons.rs +++ b/examples/stress_tests/many_buttons.rs @@ -5,7 +5,7 @@ use bevy::{ color::palettes::css::ORANGE_RED, diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, prelude::*, - window::{PresentMode, WindowPlugin, WindowResolution}, + window::{PresentMode, WindowResolution}, winit::{UpdateMode, WinitSettings}, }; diff --git a/examples/stress_tests/many_glyphs.rs b/examples/stress_tests/many_glyphs.rs index ff7b68f6b9..ca4bc6db28 100644 --- a/examples/stress_tests/many_glyphs.rs +++ b/examples/stress_tests/many_glyphs.rs @@ -10,7 +10,7 @@ use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, prelude::*, text::{BreakLineOn, Text2dBounds}, - window::{PresentMode, WindowPlugin, WindowResolution}, + window::{PresentMode, WindowResolution}, winit::{UpdateMode, WinitSettings}, }; diff --git a/examples/stress_tests/many_lights.rs b/examples/stress_tests/many_lights.rs index b9134c42c4..e37a096562 100644 --- a/examples/stress_tests/many_lights.rs +++ b/examples/stress_tests/many_lights.rs @@ -10,7 +10,7 @@ use bevy::{ pbr::{ExtractedPointLight, GlobalLightMeta}, prelude::*, render::{camera::ScalingMode, Render, RenderApp, RenderSet}, - window::{PresentMode, WindowPlugin, WindowResolution}, + window::{PresentMode, WindowResolution}, winit::{UpdateMode, WinitSettings}, }; use rand::{thread_rng, Rng}; diff --git a/examples/stress_tests/many_sprites.rs b/examples/stress_tests/many_sprites.rs index 1562b44e63..fb08d2942f 100644 --- a/examples/stress_tests/many_sprites.rs +++ b/examples/stress_tests/many_sprites.rs @@ -11,7 +11,7 @@ use bevy::{ color::palettes::css::*, diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, prelude::*, - window::{PresentMode, WindowPlugin, WindowResolution}, + window::{PresentMode, WindowResolution}, winit::{UpdateMode, WinitSettings}, }; diff --git a/examples/stress_tests/text_pipeline.rs b/examples/stress_tests/text_pipeline.rs index 7ce555a9fb..716d867d0d 100644 --- a/examples/stress_tests/text_pipeline.rs +++ b/examples/stress_tests/text_pipeline.rs @@ -7,7 +7,7 @@ use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, prelude::*, text::{BreakLineOn, Text2dBounds}, - window::{PresentMode, WindowPlugin, WindowResolution}, + window::{PresentMode, WindowResolution}, winit::{UpdateMode, WinitSettings}, }; diff --git a/examples/tools/gamepad_viewer.rs b/examples/tools/gamepad_viewer.rs index 58b4f503cf..c99f3f01be 100644 --- a/examples/tools/gamepad_viewer.rs +++ b/examples/tools/gamepad_viewer.rs @@ -3,9 +3,7 @@ use std::f32::consts::PI; use bevy::{ - input::gamepad::{ - GamepadAxisChangedEvent, GamepadButton, GamepadButtonChangedEvent, GamepadSettings, - }, + input::gamepad::{GamepadAxisChangedEvent, GamepadButtonChangedEvent, GamepadSettings}, prelude::*, sprite::{Anchor, MaterialMesh2dBundle, Mesh2dHandle}, }; diff --git a/examples/tools/scene_viewer/main.rs b/examples/tools/scene_viewer/main.rs index b22abb000b..aebd3064ff 100644 --- a/examples/tools/scene_viewer/main.rs +++ b/examples/tools/scene_viewer/main.rs @@ -11,7 +11,6 @@ use bevy::{ math::Vec3A, prelude::*, render::primitives::{Aabb, Sphere}, - window::WindowPlugin, }; #[path = "../../helpers/camera_controller.rs"] diff --git a/examples/transforms/align.rs b/examples/transforms/align.rs index 37dd13a079..f5b152775f 100644 --- a/examples/transforms/align.rs +++ b/examples/transforms/align.rs @@ -1,10 +1,7 @@ //! This example shows how to align the orientations of objects in 3D space along two axes using the `Transform::align` API. -use bevy::color::{ - palettes::basic::{GRAY, RED, WHITE}, - Color, -}; -use bevy::input::mouse::{MouseButton, MouseButtonInput, MouseMotion}; +use bevy::color::palettes::basic::{GRAY, RED, WHITE}; +use bevy::input::mouse::{MouseButtonInput, MouseMotion}; use bevy::prelude::*; use rand::{Rng, SeedableRng}; use rand_chacha::ChaCha8Rng; diff --git a/examples/ui/text_debug.rs b/examples/ui/text_debug.rs index c8f06d91c1..5f0cc6b8eb 100644 --- a/examples/ui/text_debug.rs +++ b/examples/ui/text_debug.rs @@ -1,10 +1,10 @@ //! Shows various text layout options. use bevy::{ - color::palettes::{basic::RED, css::*}, + color::palettes::css::*, diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin}, prelude::*, - window::{PresentMode, WindowPlugin}, + window::PresentMode, }; fn main() { diff --git a/examples/window/low_power.rs b/examples/window/low_power.rs index 3782d50171..8d6593fc66 100644 --- a/examples/window/low_power.rs +++ b/examples/window/low_power.rs @@ -6,7 +6,7 @@ use bevy::{ prelude::*, utils::Duration, - window::{PresentMode, RequestRedraw, WindowPlugin}, + window::{PresentMode, RequestRedraw}, winit::WinitSettings, }; diff --git a/examples/window/transparent_window.rs b/examples/window/transparent_window.rs index ffb8090208..f95408ff52 100644 --- a/examples/window/transparent_window.rs +++ b/examples/window/transparent_window.rs @@ -4,12 +4,9 @@ //! [documentation](https://docs.rs/bevy/latest/bevy/prelude/struct.Window.html#structfield.transparent) //! for more details. +use bevy::prelude::*; #[cfg(target_os = "macos")] use bevy::window::CompositeAlphaMode; -use bevy::{ - prelude::*, - window::{Window, WindowPlugin}, -}; fn main() { App::new() diff --git a/tests/how_to_test_systems.rs b/tests/how_to_test_systems.rs index f14a14a60e..53ac65310f 100644 --- a/tests/how_to_test_systems.rs +++ b/tests/how_to_test_systems.rs @@ -1,4 +1,4 @@ -use bevy::{ecs::event::Events, prelude::*}; +use bevy::prelude::*; #[derive(Component, Default)] struct Enemy { diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index 617f96f7f7..d5e4f62487 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -18,6 +18,7 @@ bitflags! { const EXAMPLE_CHECK = 0b10000000; const COMPILE_CHECK = 0b100000000; const CFG_CHECK = 0b1000000000; + const TEST_CHECK = 0b10000000000; } } @@ -56,13 +57,18 @@ fn main() { ("doc", Check::DOC_TEST | Check::DOC_CHECK), ( "compile", - Check::COMPILE_FAIL | Check::BENCH_CHECK | Check::EXAMPLE_CHECK | Check::COMPILE_CHECK, + Check::COMPILE_FAIL + | Check::BENCH_CHECK + | Check::EXAMPLE_CHECK + | Check::COMPILE_CHECK + | Check::TEST_CHECK, ), ("format", Check::FORMAT), ("clippy", Check::CLIPPY), ("compile-fail", Check::COMPILE_FAIL), ("bench-check", Check::BENCH_CHECK), ("example-check", Check::EXAMPLE_CHECK), + ("test-check", Check::TEST_CHECK), ("cfg-check", Check::CFG_CHECK), ("doc-check", Check::DOC_CHECK), ("doc-test", Check::DOC_TEST), @@ -314,6 +320,24 @@ fn main() { ); } + if checks.contains(Check::TEST_CHECK) { + let mut args = vec!["--workspace", "--tests"]; + + if flags.contains(Flag::KEEP_GOING) { + args.push("--keep-going"); + } + + test_suite.insert( + Check::TEST_CHECK, + vec![CITest { + command: cmd!(sh, "cargo check {args...}"), + failure_message: "Please fix compiler examples for tests in output above.", + subdir: None, + env_vars: Vec::new(), + }], + ); + } + // Actually run the tests: let mut failed_checks: Check = Check::empty();