From 5bcae7455be5042f10e770488129c5b150a21aea Mon Sep 17 00:00:00 2001 From: Niklas Eicker Date: Sat, 24 Feb 2024 10:54:27 +0100 Subject: [PATCH 1/2] Enable more integration tests to run with all tested feature combinations --- .../tests/can_run_without_next_state.rs | 44 ++++++------ .../tests/continues_to_failure_state.rs | 18 ++--- .../tests/continues_without_collection.rs | 16 ++--- bevy_asset_loader/tests/init_resource.rs | 42 +++++------ .../tests/mapped_path_use_slash.rs | 40 +++++------ .../tests/multiple_asset_collections.rs | 46 ++++++------ bevy_asset_loader/tests/multiple_states.rs | 68 +++++++++--------- .../tests/reload_dynamic_asset_files.rs | 70 +++++++++---------- 8 files changed, 158 insertions(+), 186 deletions(-) diff --git a/bevy_asset_loader/tests/can_run_without_next_state.rs b/bevy_asset_loader/tests/can_run_without_next_state.rs index 973891e..75c2094 100644 --- a/bevy_asset_loader/tests/can_run_without_next_state.rs +++ b/bevy_asset_loader/tests/can_run_without_next_state.rs @@ -1,35 +1,31 @@ -#![allow(dead_code, unused_imports)] - use bevy::app::AppExit; use bevy::asset::AssetPlugin; use bevy::audio::AudioPlugin; use bevy::prelude::*; use bevy_asset_loader::prelude::*; -#[cfg(all( - not(feature = "2d"), - not(feature = "3d"), - not(feature = "progress_tracking") -))] #[test] fn can_run_without_next_state() { - App::new() - .init_state::() - .add_plugins(( - MinimalPlugins, - AssetPlugin::default(), - AudioPlugin::default(), - )) - .add_loading_state(LoadingState::new(MyStates::Load).load_collection::()) - .init_resource::() - .add_systems( - Update, - ( - expect.run_if(in_state(MyStates::Load)), - timeout.run_if(in_state(MyStates::Load)), - ), - ) - .run(); + let mut app = App::new(); + app.init_state::(); + + #[cfg(feature = "progress_tracking")] + app.add_plugins(iyes_progress::ProgressPlugin::new(MyStates::Load)); + app.add_plugins(( + MinimalPlugins, + AssetPlugin::default(), + AudioPlugin::default(), + )) + .add_loading_state(LoadingState::new(MyStates::Load).load_collection::()) + .init_resource::() + .add_systems( + Update, + ( + expect.run_if(in_state(MyStates::Load)), + timeout.run_if(in_state(MyStates::Load)), + ), + ) + .run(); } fn timeout(time: Res