aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/tests
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-12-22 21:43:54 -1400
committermat <git@matdoes.dev>2025-12-22 21:43:54 -1400
commit82e3d46ca319badcbc584cf902aeebcbd30948b9 (patch)
tree4afb8c6135caacbdf9f1f04d451cb2bae1c488b6 /azalea-client/tests
parent0429a81d706da7c45600d357f9f9a14cef6113b4 (diff)
downloadazalea-drasl-82e3d46ca319badcbc584cf902aeebcbd30948b9.tar.xz
run azalea-client integration tests as one binary
per https://corrode.dev/blog/tips-for-faster-rust-compile-times/\#combine-all-integration-tests-into-a-single-binary <3
Diffstat (limited to 'azalea-client/tests')
-rw-r--r--azalea-client/tests/main.rs1
-rw-r--r--azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs (renamed from azalea-client/tests/change_dimension_to_nether_and_back.rs)2
-rw-r--r--azalea-client/tests/simulation/client_disconnect.rs (renamed from azalea-client/tests/client_disconnect.rs)2
-rw-r--r--azalea-client/tests/simulation/close_open_container.rs (renamed from azalea-client/tests/close_open_container.rs)2
-rw-r--r--azalea-client/tests/simulation/correct_movement.rs (renamed from azalea-client/tests/correct_movement.rs)2
-rw-r--r--azalea-client/tests/simulation/correct_sneak_movement.rs (renamed from azalea-client/tests/correct_sneak_movement.rs)2
-rw-r--r--azalea-client/tests/simulation/correct_sprint_sneak_movement.rs (renamed from azalea-client/tests/correct_sprint_sneak_movement.rs)2
-rw-r--r--azalea-client/tests/simulation/despawn_entities_when_changing_dimension.rs (renamed from azalea-client/tests/despawn_entities_when_changing_dimension.rs)2
-rw-r--r--azalea-client/tests/simulation/enchantments.rs (renamed from azalea-client/tests/enchantments.rs)2
-rw-r--r--azalea-client/tests/simulation/fast_login.rs (renamed from azalea-client/tests/fast_login.rs)2
-rw-r--r--azalea-client/tests/simulation/login_to_dimension_with_same_name.rs (renamed from azalea-client/tests/login_to_dimension_with_same_name.rs)2
-rw-r--r--azalea-client/tests/simulation/mine_block_rollback.rs (renamed from azalea-client/tests/mine_block_rollback.rs)2
-rw-r--r--azalea-client/tests/simulation/mine_block_timing_hand.rs (renamed from azalea-client/tests/mine_block_timing_hand.rs)2
-rw-r--r--azalea-client/tests/simulation/mine_block_without_rollback.rs (renamed from azalea-client/tests/mine_block_without_rollback.rs)2
-rw-r--r--azalea-client/tests/simulation/mod.rs25
-rw-r--r--azalea-client/tests/simulation/move_and_despawn_entity.rs (renamed from azalea-client/tests/move_and_despawn_entity.rs)2
-rw-r--r--azalea-client/tests/simulation/move_despawned_entity.rs (renamed from azalea-client/tests/move_despawned_entity.rs)2
-rw-r--r--azalea-client/tests/simulation/packet_order.rs (renamed from azalea-client/tests/packet_order.rs)2
-rw-r--r--azalea-client/tests/simulation/packet_order_set_carried_item.rs (renamed from azalea-client/tests/packet_order_set_carried_item.rs)2
-rw-r--r--azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs (renamed from azalea-client/tests/receive_spawn_entity_and_start_config_packet.rs)2
-rw-r--r--azalea-client/tests/simulation/receive_start_config_packet.rs (renamed from azalea-client/tests/receive_start_config_packet.rs)2
-rw-r--r--azalea-client/tests/simulation/reply_to_ping_with_pong.rs (renamed from azalea-client/tests/reply_to_ping_with_pong.rs)2
-rw-r--r--azalea-client/tests/simulation/set_health_before_login.rs (renamed from azalea-client/tests/set_health_before_login.rs)2
-rw-r--r--azalea-client/tests/simulation/teleport_movement.rs (renamed from azalea-client/tests/teleport_movement.rs)2
-rw-r--r--azalea-client/tests/simulation/ticks_alive.rs (renamed from azalea-client/tests/ticks_alive.rs)2
25 files changed, 49 insertions, 23 deletions
diff --git a/azalea-client/tests/main.rs b/azalea-client/tests/main.rs
new file mode 100644
index 00000000..4030c61d
--- /dev/null
+++ b/azalea-client/tests/main.rs
@@ -0,0 +1 @@
+mod simulation;
diff --git a/azalea-client/tests/change_dimension_to_nether_and_back.rs b/azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs
index 134c7cbf..2d4fb749 100644
--- a/azalea-client/tests/change_dimension_to_nether_and_back.rs
+++ b/azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs
@@ -11,7 +11,7 @@ use simdnbt::owned::{NbtCompound, NbtTag};
#[test]
fn test_change_dimension_to_nether_and_back() {
- init_tracing();
+ let _lock = init();
generic_test_change_dimension_to_nether_and_back(true);
generic_test_change_dimension_to_nether_and_back(false);
diff --git a/azalea-client/tests/client_disconnect.rs b/azalea-client/tests/simulation/client_disconnect.rs
index fc17da0c..0956fbfa 100644
--- a/azalea-client/tests/client_disconnect.rs
+++ b/azalea-client/tests/simulation/client_disconnect.rs
@@ -4,7 +4,7 @@ use azalea_world::InstanceName;
#[test]
fn test_client_disconnect() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
diff --git a/azalea-client/tests/close_open_container.rs b/azalea-client/tests/simulation/close_open_container.rs
index 32a9874d..033451f1 100644
--- a/azalea-client/tests/close_open_container.rs
+++ b/azalea-client/tests/simulation/close_open_container.rs
@@ -10,7 +10,7 @@ use azalea_registry::builtin::MenuKind;
#[test]
fn test_close_open_container() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
diff --git a/azalea-client/tests/correct_movement.rs b/azalea-client/tests/simulation/correct_movement.rs
index de494111..2a1a8f26 100644
--- a/azalea-client/tests/correct_movement.rs
+++ b/azalea-client/tests/simulation/correct_movement.rs
@@ -15,7 +15,7 @@ use azalea_registry::builtin::BlockKind;
#[test]
fn test_correct_movement() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
let sent_packets = SentPackets::new(&mut simulation);
diff --git a/azalea-client/tests/correct_sneak_movement.rs b/azalea-client/tests/simulation/correct_sneak_movement.rs
index 1186ce8b..73abb26f 100644
--- a/azalea-client/tests/correct_sneak_movement.rs
+++ b/azalea-client/tests/simulation/correct_sneak_movement.rs
@@ -15,7 +15,7 @@ use azalea_registry::builtin::BlockKind;
#[test]
fn test_correct_sneak_movement() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
let sent_packets = SentPackets::new(&mut simulation);
diff --git a/azalea-client/tests/correct_sprint_sneak_movement.rs b/azalea-client/tests/simulation/correct_sprint_sneak_movement.rs
index 8ab955b8..a96c7024 100644
--- a/azalea-client/tests/correct_sprint_sneak_movement.rs
+++ b/azalea-client/tests/simulation/correct_sprint_sneak_movement.rs
@@ -15,7 +15,7 @@ use azalea_registry::builtin::BlockKind;
#[test]
fn test_correct_sprint_sneak_movement() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
let sent_packets = SentPackets::new(&mut simulation);
diff --git a/azalea-client/tests/despawn_entities_when_changing_dimension.rs b/azalea-client/tests/simulation/despawn_entities_when_changing_dimension.rs
index 466da948..8619bb2d 100644
--- a/azalea-client/tests/despawn_entities_when_changing_dimension.rs
+++ b/azalea-client/tests/simulation/despawn_entities_when_changing_dimension.rs
@@ -13,7 +13,7 @@ use simdnbt::owned::{NbtCompound, NbtTag};
#[test]
fn test_despawn_entities_when_changing_dimension() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Configuration);
simulation.receive_packet(ClientboundRegistryData {
diff --git a/azalea-client/tests/enchantments.rs b/azalea-client/tests/simulation/enchantments.rs
index 4486fba1..f9834230 100644
--- a/azalea-client/tests/enchantments.rs
+++ b/azalea-client/tests/simulation/enchantments.rs
@@ -11,7 +11,7 @@ use simdnbt::owned::{NbtCompound, NbtTag};
#[test]
fn test_enchantments() {
- init_tracing();
+ let _lock = init();
let mut s = Simulation::new(ConnectionProtocol::Configuration);
s.receive_packet(ClientboundRegistryData {
diff --git a/azalea-client/tests/fast_login.rs b/azalea-client/tests/simulation/fast_login.rs
index 5a653425..270f4464 100644
--- a/azalea-client/tests/fast_login.rs
+++ b/azalea-client/tests/simulation/fast_login.rs
@@ -10,7 +10,7 @@ use simdnbt::owned::{NbtCompound, NbtTag};
#[test]
fn test_fast_login() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Configuration);
assert!(simulation.has_component::<InConfigState>());
diff --git a/azalea-client/tests/login_to_dimension_with_same_name.rs b/azalea-client/tests/simulation/login_to_dimension_with_same_name.rs
index 4adced62..917c50bb 100644
--- a/azalea-client/tests/login_to_dimension_with_same_name.rs
+++ b/azalea-client/tests/simulation/login_to_dimension_with_same_name.rs
@@ -14,7 +14,7 @@ use simdnbt::owned::{NbtCompound, NbtTag};
#[test]
fn test_login_to_dimension_with_same_name() {
- init_tracing();
+ let _lock = init();
generic_test_login_to_dimension_with_same_name(true);
generic_test_login_to_dimension_with_same_name(false);
diff --git a/azalea-client/tests/mine_block_rollback.rs b/azalea-client/tests/simulation/mine_block_rollback.rs
index 7d2ed1a5..98440f76 100644
--- a/azalea-client/tests/mine_block_rollback.rs
+++ b/azalea-client/tests/simulation/mine_block_rollback.rs
@@ -8,7 +8,7 @@ use azalea_registry::builtin::BlockKind;
#[test]
fn test_mine_block_rollback() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
simulation.receive_packet(default_login_packet());
diff --git a/azalea-client/tests/mine_block_timing_hand.rs b/azalea-client/tests/simulation/mine_block_timing_hand.rs
index d3dd9c30..53571089 100644
--- a/azalea-client/tests/mine_block_timing_hand.rs
+++ b/azalea-client/tests/simulation/mine_block_timing_hand.rs
@@ -19,7 +19,7 @@ use azalea_registry::builtin::BlockKind;
#[test]
fn test_mine_block_timing_hand() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
let sent_packets = SentPackets::new(&mut simulation);
diff --git a/azalea-client/tests/mine_block_without_rollback.rs b/azalea-client/tests/simulation/mine_block_without_rollback.rs
index b6020ea2..71f360c4 100644
--- a/azalea-client/tests/mine_block_without_rollback.rs
+++ b/azalea-client/tests/simulation/mine_block_without_rollback.rs
@@ -8,7 +8,7 @@ use azalea_registry::builtin::BlockKind;
#[test]
fn test_mine_block_without_rollback() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
simulation.receive_packet(default_login_packet());
diff --git a/azalea-client/tests/simulation/mod.rs b/azalea-client/tests/simulation/mod.rs
new file mode 100644
index 00000000..d090862b
--- /dev/null
+++ b/azalea-client/tests/simulation/mod.rs
@@ -0,0 +1,25 @@
+// This file is @generated by `azalea-client/build.rs`.
+
+mod change_dimension_to_nether_and_back;
+mod client_disconnect;
+mod close_open_container;
+mod correct_movement;
+mod correct_sneak_movement;
+mod correct_sprint_sneak_movement;
+mod despawn_entities_when_changing_dimension;
+mod enchantments;
+mod fast_login;
+mod login_to_dimension_with_same_name;
+mod mine_block_rollback;
+mod mine_block_timing_hand;
+mod mine_block_without_rollback;
+mod move_and_despawn_entity;
+mod move_despawned_entity;
+mod packet_order;
+mod packet_order_set_carried_item;
+mod receive_spawn_entity_and_start_config_packet;
+mod receive_start_config_packet;
+mod reply_to_ping_with_pong;
+mod set_health_before_login;
+mod teleport_movement;
+mod ticks_alive;
diff --git a/azalea-client/tests/move_and_despawn_entity.rs b/azalea-client/tests/simulation/move_and_despawn_entity.rs
index 8a143243..6c334a47 100644
--- a/azalea-client/tests/move_and_despawn_entity.rs
+++ b/azalea-client/tests/simulation/move_and_despawn_entity.rs
@@ -12,7 +12,7 @@ use azalea_world::MinecraftEntityId;
#[test]
fn test_move_and_despawn_entity() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
simulation.receive_packet(default_login_packet());
diff --git a/azalea-client/tests/move_despawned_entity.rs b/azalea-client/tests/simulation/move_despawned_entity.rs
index dad2a710..7a171dae 100644
--- a/azalea-client/tests/move_despawned_entity.rs
+++ b/azalea-client/tests/simulation/move_despawned_entity.rs
@@ -9,7 +9,7 @@ use tracing::Level;
#[test]
fn test_move_despawned_entity() {
- init_tracing_with_level(Level::ERROR); // a warning is expected here
+ let _lock = init_with_level(Level::ERROR); // a warning is expected here
let mut simulation = Simulation::new(ConnectionProtocol::Game);
simulation.receive_packet(default_login_packet());
diff --git a/azalea-client/tests/packet_order.rs b/azalea-client/tests/simulation/packet_order.rs
index 619ed0b6..ef99b938 100644
--- a/azalea-client/tests/packet_order.rs
+++ b/azalea-client/tests/simulation/packet_order.rs
@@ -15,7 +15,7 @@ use azalea_registry::builtin::BlockKind;
#[test]
fn test_packet_order() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
let sent_packets = SentPackets::new(&mut simulation);
diff --git a/azalea-client/tests/packet_order_set_carried_item.rs b/azalea-client/tests/simulation/packet_order_set_carried_item.rs
index e8ac386f..cae7c56a 100644
--- a/azalea-client/tests/packet_order_set_carried_item.rs
+++ b/azalea-client/tests/simulation/packet_order_set_carried_item.rs
@@ -21,7 +21,7 @@ use azalea_registry::builtin::BlockKind;
#[test]
fn test_packet_order_set_carried_item() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
let sent_packets = SentPackets::new(&mut simulation);
diff --git a/azalea-client/tests/receive_spawn_entity_and_start_config_packet.rs b/azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs
index dfb1fef9..13dd38fc 100644
--- a/azalea-client/tests/receive_spawn_entity_and_start_config_packet.rs
+++ b/azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs
@@ -10,7 +10,7 @@ use uuid::Uuid;
#[test]
fn test_receive_spawn_entity_and_start_config_packet() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
simulation.receive_packet(default_login_packet());
diff --git a/azalea-client/tests/receive_start_config_packet.rs b/azalea-client/tests/simulation/receive_start_config_packet.rs
index bb948488..f87d65da 100644
--- a/azalea-client/tests/receive_start_config_packet.rs
+++ b/azalea-client/tests/simulation/receive_start_config_packet.rs
@@ -4,7 +4,7 @@ use azalea_world::InstanceName;
#[test]
fn test_receive_start_config_packet() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
diff --git a/azalea-client/tests/reply_to_ping_with_pong.rs b/azalea-client/tests/simulation/reply_to_ping_with_pong.rs
index 6b7cb4ca..f77bf4bf 100644
--- a/azalea-client/tests/reply_to_ping_with_pong.rs
+++ b/azalea-client/tests/simulation/reply_to_ping_with_pong.rs
@@ -18,7 +18,7 @@ use simdnbt::owned::{NbtCompound, NbtTag};
#[test]
fn reply_to_ping_with_pong() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Configuration);
diff --git a/azalea-client/tests/set_health_before_login.rs b/azalea-client/tests/simulation/set_health_before_login.rs
index 4c1ec3f6..7d183b80 100644
--- a/azalea-client/tests/set_health_before_login.rs
+++ b/azalea-client/tests/simulation/set_health_before_login.rs
@@ -10,7 +10,7 @@ use simdnbt::owned::{NbtCompound, NbtTag};
#[test]
fn test_set_health_before_login() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Configuration);
assert!(simulation.has_component::<InConfigState>());
diff --git a/azalea-client/tests/teleport_movement.rs b/azalea-client/tests/simulation/teleport_movement.rs
index 03df5b92..06a8f0b6 100644
--- a/azalea-client/tests/teleport_movement.rs
+++ b/azalea-client/tests/simulation/teleport_movement.rs
@@ -20,7 +20,7 @@ use azalea_world::MinecraftEntityId;
#[test]
fn test_teleport_movement() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
let sent_packets = SentPackets::new(&mut simulation);
diff --git a/azalea-client/tests/ticks_alive.rs b/azalea-client/tests/simulation/ticks_alive.rs
index f2081002..655504db 100644
--- a/azalea-client/tests/ticks_alive.rs
+++ b/azalea-client/tests/simulation/ticks_alive.rs
@@ -3,7 +3,7 @@ use azalea_protocol::packets::ConnectionProtocol;
#[test]
fn counter_increments_and_resets_on_disconnect() {
- init_tracing();
+ let _lock = init();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
simulation.tick();