fix tests

This commit is contained in:
Jaroslaw Konik 2025-05-08 23:31:10 +02:00
parent 096710d118
commit d8f74b0d12
3 changed files with 13 additions and 13 deletions

View file

@ -26,12 +26,12 @@ rhai = { version = "1.14.0", features = [
thiserror = "1.0.40" thiserror = "1.0.40"
anyhow = "1.0.82" anyhow = "1.0.82"
tracing = "0.1.40" tracing = "0.1.40"
lua = { version = "0.9.8", features = [ mlua = { version = "0.9.8", features = [
"luajit", "luajit",
"vendored", "vendored",
"send", "send",
], optional = true } ], optional = true }
magnus = { version = "0.6.4", optional = true } magnus = { version = "0.7.1", optional = true }
[[example]] [[example]]
name = "call_function_from_rust_rhai" name = "call_function_from_rust_rhai"

View file

@ -1,6 +1,6 @@
use bevy::{ use bevy::{
asset::Asset, asset::Asset,
ecs::{component::Component, schedule::ScheduleLabel, system::Resource}, ecs::{component::Component, entity::Entity, resource::Resource, schedule::ScheduleLabel},
reflect::TypePath, reflect::TypePath,
}; };
use serde::Deserialize; use serde::Deserialize;

View file

@ -1,17 +1,17 @@
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
use std::sync::OnceLock; use std::sync::OnceLock;
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
use bevy::ecs::system::RunSystemOnce as _; use bevy::ecs::system::RunSystemOnce as _;
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
use bevy::prelude::*; use bevy::prelude::*;
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
use bevy_scriptum::{prelude::*, FuncArgs, Runtime}; use bevy_scriptum::{prelude::*, FuncArgs, Runtime};
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
static TRACING_SUBSCRIBER: OnceLock<()> = OnceLock::new(); static TRACING_SUBSCRIBER: OnceLock<()> = OnceLock::new();
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
fn build_test_app() -> App { fn build_test_app() -> App {
let mut app = App::new(); let mut app = App::new();
@ -25,7 +25,7 @@ fn build_test_app() -> App {
app app
} }
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
fn run_script<R: Runtime, Out, Marker>( fn run_script<R: Runtime, Out, Marker>(
app: &mut App, app: &mut App,
path: String, path: String,
@ -42,7 +42,7 @@ fn run_script<R: Runtime, Out, Marker>(
entity_id entity_id
} }
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
fn call_script_on_update_from_rust<R: Runtime>( fn call_script_on_update_from_rust<R: Runtime>(
mut scripted_entities: Query<(Entity, &mut R::ScriptData)>, mut scripted_entities: Query<(Entity, &mut R::ScriptData)>,
scripting_runtime: ResMut<R>, scripting_runtime: ResMut<R>,
@ -55,7 +55,7 @@ fn call_script_on_update_from_rust<R: Runtime>(
.unwrap(); .unwrap();
} }
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
trait AssertStateKeyValue { trait AssertStateKeyValue {
type ScriptData; type ScriptData;
fn assert_state_key_value_i64(world: &World, entity_id: Entity, key: &str, value: i64); fn assert_state_key_value_i64(world: &World, entity_id: Entity, key: &str, value: i64);
@ -63,7 +63,7 @@ trait AssertStateKeyValue {
fn assert_state_key_value_string(world: &World, entity_id: Entity, key: &str, value: &str); fn assert_state_key_value_string(world: &World, entity_id: Entity, key: &str, value: &str);
} }
#[cfg(any(feature = "rhai", feature = "lua"))] #[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))]
macro_rules! scripting_tests { macro_rules! scripting_tests {
($runtime:ty, $script:literal, $extension:literal) => { ($runtime:ty, $script:literal, $extension:literal) => {
use super::*; use super::*;