Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ itertools = "0.8"
rayon = "1.2"
crossbeam-channel = "0.4.0"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.3" }

[[bench]]
name = "benchmarks"
harness = false
Expand Down
2 changes: 1 addition & 1 deletion legion_core/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ impl Drop for CommandBuffer {
}

#[cfg(test)]
mod tests {
pub mod tests {
use super::*;
use crate::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion legion_core/src/cons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl_flatten!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V,
fn test_api() {}

#[cfg(test)]
mod tests {
pub mod tests {
use super::*;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion legion_core/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ impl<'a> Iterator for CreateEntityIter<'a> {
}

#[cfg(test)]
mod tests {
pub mod tests {
use crate::entity::*;
use std::collections::HashSet;

Expand Down
2 changes: 1 addition & 1 deletion legion_core/src/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ impl<'a, 'b> Filter<ChunksetFilterData<'b>> for DynamicTagLayout<'a> {
}

#[cfg(test)]
mod tests {
pub mod tests {
use super::*;

#[derive(Clone, Copy, Debug, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion legion_systems/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ impl_resource_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,
impl_resource_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z);

#[cfg(test)]
mod tests {
pub mod tests {
use super::*;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion legion_systems/src/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ impl From<Vec<Step>> for Schedule {
}

#[cfg(test)]
mod tests {
pub mod tests {
use super::*;
use crate::prelude::*;
use itertools::sorted;
Expand Down
16 changes: 15 additions & 1 deletion legion_systems/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ where
}

#[cfg(test)]
mod tests {
pub mod tests {
use super::*;
use crate::schedule::*;
use legion_core::prelude::*;
Expand Down Expand Up @@ -1744,4 +1744,18 @@ mod tests {
}
});
}

#[cfg(all(target_arch = "wasm32", not(features = "par-schedule")))]
mod wasm {
#[wasm_bindgen_test]
fn system_mutate_archetype_buffer() { super::system_mutate_archetype_buffer() }
#[wasm_bindgen_test]
fn system_mutate_archetype() { super::system_mutate_archetype() }
#[wasm_bindgen_test]
fn fnmut_stateful_system_test() { super::fnmut_stateful_system_test() }
#[wasm_bindgen_test]
fn builder_create_and_execute() { super::builder_create_and_execute() }
#[wasm_bindgen_test]
fn builder_schedule_execute() { super::builder_schedule_execute() }
}
}
92 changes: 92 additions & 0 deletions tests/query_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,3 +606,95 @@ fn query_iter_tag() {
assert_eq!(&Model(*c), m);
}
}

#[cfg(all(target_arch = "wasm32", not(features = "par-iter")))]
mod wasm {
use wasm_bindgen_test::*;

#[wasm_bindgen_test]
fn uery_iter_chunks_tag() {
super::query_iter_chunks_tag()
}

#[wasm_bindgen_test]
fn query_read_entity_data() {
super::query_read_entity_data()
}

#[wasm_bindgen_test]
fn query_try_read_entity_data() {
super::query_try_read_entity_data()
}

#[wasm_bindgen_test]
fn query_try_write_entity_data() {
super::query_try_write_entity_data()
}

#[wasm_bindgen_test]
fn query_cached_read_entity_data() {
super::query_cached_read_entity_data()
}

#[cfg(feature = "par-iter")]
#[wasm_bindgen_test]
fn query_read_entity_data_par() {
super::query_read_entity_data_par()
}

#[wasm_bindgen_test]
fn query_read_entity_data_tuple() {
super::query_read_entity_data_tuple()
}

#[wasm_bindgen_test]
fn query_write_entity_data() {
super::query_write_entity_data()
}

#[wasm_bindgen_test]
fn query_write_entity_data_tuple() {
super::query_write_entity_data_tuple()
}

#[wasm_bindgen_test]
fn query_mixed_entity_data_tuple() {
super::query_mixed_entity_data_tuple()
}

#[cfg(feature = "par-iter")]
#[wasm_bindgen_test]
fn query_partial_match() {
super::query_partial_match()
}

#[wasm_bindgen_test]
fn query_read_shared_data() {
super::query_read_shared_data()
}

#[wasm_bindgen_test]
fn query_on_changed_first() {
super::query_on_changed_first()
}

#[wasm_bindgen_test]
fn query_on_changed_no_changes() {
super::query_on_changed_no_changes()
}

#[wasm_bindgen_test]
fn query_on_changed_self_changes() {
super::query_on_changed_self_changes()
}

#[wasm_bindgen_test]
fn query_try_with_changed_filter() {
super::query_try_with_changed_filter()
}

#[wasm_bindgen_test]
fn query_iter_tag() {
super::query_iter_tag()
}
}
Loading