From d1a369655a449659fa9359a7d7997d843855aa39 Mon Sep 17 00:00:00 2001 From: "kaosat.dev" Date: Wed, 15 Nov 2023 14:28:16 +0100 Subject: [PATCH] test(bevy_gltf_components): experimenting with tests --- crates/bevy_gltf_components/Cargo.toml | 4 + .../assets/models/level1.glb | Bin 0 -> 66996 bytes crates/bevy_gltf_components/src/lib.rs | 4 +- crates/bevy_gltf_components/tests/test.rs | 119 ++++++++++++++++++ crates/bevy_gltf_components/tests/test2.rs | 84 +++++++++++++ 5 files changed, 209 insertions(+), 2 deletions(-) create mode 100644 crates/bevy_gltf_components/assets/models/level1.glb create mode 100644 crates/bevy_gltf_components/tests/test.rs create mode 100644 crates/bevy_gltf_components/tests/test2.rs diff --git a/crates/bevy_gltf_components/Cargo.toml b/crates/bevy_gltf_components/Cargo.toml index d7ba122..2e8cb00 100644 --- a/crates/bevy_gltf_components/Cargo.toml +++ b/crates/bevy_gltf_components/Cargo.toml @@ -17,3 +17,7 @@ bevy = { version = "0.12", default-features = false, features = ["bevy_asset", " bevy = { version = "0.12", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf"] } serde = "1.0.188" ron = "0.8.1" + +[[test]] +name = "components_injections_test2" +path = "tests/test2.rs" \ No newline at end of file diff --git a/crates/bevy_gltf_components/assets/models/level1.glb b/crates/bevy_gltf_components/assets/models/level1.glb new file mode 100644 index 0000000000000000000000000000000000000000..abcf17048c41aef85276dfd070e6ad679b340b5c GIT binary patch literal 66996 zcmeHw378#4wSN`+z9Tz^LH1#|``ihc?g?Qh5J2=AeiI3Mf7# zfb1xXAp1ik-4Sp>6A@Ps7ZgPl6cwNQd;EXDx>Y@=@4bDyhxq>A_rA}Wud9Ated^RX zr_QPB?pycPg29=GucMTDWPPnJDJpgJjA_T6-`2ZyY2QfO#Pi!0^eyfi?j0E#ZkyP4 z%);TJ#Y0OcEI^eBhYa>Dp5He-;i!YAO*p&QQRygjwzapN-8Z~+U}!Oj3mv((3)|cJ z&K>Dn%%Y_yF72D&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ng z6hCWDJCQzXPX8c%)|`Gr`m8zoiS$`>`ZMY4^9>G~*v<0#oc+Y|tU3LK^jUNIA?dT` z^bgW!%^AlW53=S@cRbNe`m8y}5z=SPIo^;yYu;}F5A_JvZtSD*IX2d>JdHIM9a!7(23D~=hqV_kVEx8KtjSn| zwHvFk!smBbzwv9V-T4jHfV`%@iuF6MVs*#Qu)61$SPAk|tPa^r{RAsKzJoP9KUXWU zQX|AFq3>c{#*0|{^8>6`c?m04idY#kiWMa#teg29R+`+4l|SFaDwVI}*FQgx6);~@ zH)A!iVg zr;MFd?#4QpgRoX*8CJ9`#d@U&v8v`XSXcCEtnv9Q*8OaS^)#QvdYkuPO-(P>+04VL zr|YmL=L)R!`3Tk$U5>R!8(_`Lg;?KH!J3~LSoL!PRv%rARYYfF4bq8NQ8R)yH#?YL zEj); + +#[derive(Resource)] +struct Loaded(u32); + +fn setup( + mut commands: Commands, + asset_server: Res, +) { + + let tmp: Handle = asset_server.load("level1.glb#Scene0"); + println!("setting up loading"); + // commands.insert_resource(AssetLoadHelper(tmp)); +} + + + +fn spawn_level( + mut asset_event_reader: EventReader>, + mut loaded: ResMut, + ){ + + //println!("loading"); + if let Some(asset_event) = asset_event_reader.iter().next() { + println!("asset event"); + match asset_event { + AssetEvent::Added { id: _ } => { + info!("GLTF loaded"); + loaded.0 += 1; + /*if scene_markers.is_empty() { + info!("spawning scene"); + commands.spawn( + ( + SceneBundle { + scene: preloaded_scene.0.clone(), + ..default() + }, + LoadedMarker, + Name::new("Level1") + ) + ); + next_state.set(AppState::Running); + }*/ + } + _ => () + } + } + + } + +// #[test] +fn components_injected() { + // Setup app + let mut app = App::new(); + app + .register_type::() + .register_type::() + .add_plugins(( + MinimalPlugins, + AssetPlugin::default(), + GltfPlugin::default(), + ScenePlugin::default() + )) + + //.add_plugins(ComponentsFromGltfPlugin) + .add_systems(Startup, setup); + // .add_systems(Update, spawn_level); + + app.insert_resource(Loaded(0)); + + // Run systems + app.run(); + /*app.update(); + app.update(); + app.update(); + app.update(); + app.update(); + app.update(); + app.update(); + app.update(); + app.update(); + app.update(); + app.update(); + + loop { + app.update(); + println!("foo {}", app.world.resource::().0); + if app.world.resource::().0 > 0 { + break; + } + }*/ + + // Check resulting changes + let mut query = app.world.query::<(Entity, &Name, &UnitTest)>(); + println!("AAAAHHH {:?}", query); + let mut results = 0; + for res in query.iter(&app.world) { + results +=1; + } + assert_eq!(results, 1); +} \ No newline at end of file diff --git a/crates/bevy_gltf_components/tests/test2.rs b/crates/bevy_gltf_components/tests/test2.rs new file mode 100644 index 0000000..f2f3030 --- /dev/null +++ b/crates/bevy_gltf_components/tests/test2.rs @@ -0,0 +1,84 @@ +use bevy::{prelude::*, gltf::{GltfPlugin, Gltf}, scene::ScenePlugin, pbr::PbrPlugin, render::RenderPlugin, core_pipeline::CorePipelinePlugin}; +use bevy_gltf_components::ComponentsFromGltfPlugin; + +#[derive(Resource)] +pub struct MyGltf(pub Handle); + +fn setup( + mut commands: Commands, + asset_server: Res, +) { + println!("setting up loading"); + commands.insert_resource(MyGltf(asset_server.load("models/level1.glb"))); +} + +fn foo( + mut asset_event_reader: EventReader>, +){ + if let Some(asset_event) = asset_event_reader.read().next() { + println!("asset event {:?}",asset_event); + match asset_event { + AssetEvent::Added { id: _ } => { + info!("GLTF Added"); + }, + AssetEvent::LoadedWithDependencies { id: _ } => { + info!("GLTF loaded"); + }, + _ => () + } + } +} +fn bruteforce( + foo: Res, + asset_server: Res, +){ + let load_state = asset_server.get_load_state(foo.0.id()); + println!("checking load state {:?}", load_state); + +} + +#[test] +fn main() { + // Setup app + let mut app = App::new(); + app + // .register_type::() + // .register_type::() + /* .add_plugins(( + MinimalPlugins, + AssetPlugin::default(), + CorePipelinePlugin::default(), + + RenderPlugin::default(), + + PbrPlugin::default(), + GltfPlugin::default(), + ScenePlugin::default(), + + HierarchyPlugin::default(), + TransformPlugin::default(), + + ))*/ + .add_plugins(DefaultPlugins) + + .add_plugins(ComponentsFromGltfPlugin) + + .add_systems(Startup, setup) + .add_systems(Update, foo) + .add_systems(Update, bruteforce) + + .run() + ; + + /*app.update(); + app.update(); + app.update(); + app.update(); + app.update(); + app.update(); + loop { + // println!("foo {:?}", app.world.resource::>().clone()); + app.update(); + }*/ + +} \ No newline at end of file