diff --git a/tests/resources/adhoc_routing/no_updates/config-1.yml b/tests/resources/adhoc_routing/no_updates/config-1.yml index f7b3cbf..41bb371 100644 --- a/tests/resources/adhoc_routing/no_updates/config-1.yml +++ b/tests/resources/adhoc_routing/no_updates/config-1.yml @@ -14,6 +14,7 @@ modules: output: type: Output output_dir: ./test_output/simulation/adhoc_routing/no_updates/one_part + logging: Info routing: type: Routing mode: AdHoc diff --git a/tests/resources/adhoc_routing/no_updates/config-2.yml b/tests/resources/adhoc_routing/no_updates/config-2.yml index 73bb2bf..757dc01 100644 --- a/tests/resources/adhoc_routing/no_updates/config-2.yml +++ b/tests/resources/adhoc_routing/no_updates/config-2.yml @@ -14,6 +14,7 @@ modules: output: type: Output output_dir: ./test_output/simulation/adhoc_routing/no_updates/two_parts + logging: Info routing: type: Routing mode: AdHoc diff --git a/tests/resources/adhoc_routing/with_updates/config-1.yml b/tests/resources/adhoc_routing/with_updates/config-1.yml index 57f382b..8ca97bd 100644 --- a/tests/resources/adhoc_routing/with_updates/config-1.yml +++ b/tests/resources/adhoc_routing/with_updates/config-1.yml @@ -14,6 +14,7 @@ modules: output: type: Output output_dir: ./test_output/simulation/adhoc_routing/with_updates/one_part + logging: Info routing: type: Routing mode: AdHoc diff --git a/tests/resources/adhoc_routing/with_updates/config-2.yml b/tests/resources/adhoc_routing/with_updates/config-2.yml index 04fc594..f87f917 100644 --- a/tests/resources/adhoc_routing/with_updates/config-2.yml +++ b/tests/resources/adhoc_routing/with_updates/config-2.yml @@ -15,6 +15,7 @@ modules: type: Output output_dir: ./test_output/simulation/adhoc_routing/with_updates/two_parts profiling: !CSV + logging: Info routing: type: Routing mode: AdHoc diff --git a/tests/test_adhoc_routing.rs b/tests/test_adhoc_routing.rs index 8c70603..f6abb08 100644 --- a/tests/test_adhoc_routing.rs +++ b/tests/test_adhoc_routing.rs @@ -1,7 +1,8 @@ use std::path::PathBuf; -use rust_q_sim::simulation::config::CommandLineArgs; +use rust_q_sim::simulation::config::{CommandLineArgs, Config}; use rust_q_sim::simulation::id::store_to_file; +use rust_q_sim::simulation::logging; use rust_q_sim::simulation::messaging::communication::communicators::DummySimCommunicator; use rust_q_sim::simulation::network::global_network::Network; use rust_q_sim::simulation::population::population::Population; @@ -67,17 +68,21 @@ fn execute_adhoc_routing_one_part_with_updates() { &PathBuf::from("./assets/adhoc_routing/with_updates/"), &PathBuf::from("./test_output/simulation/adhoc_routing/with_updates/one_part/"), ); - let config_args = CommandLineArgs { + let args = CommandLineArgs { config_path: "./tests/resources/adhoc_routing/with_updates/config-1.yml".to_string(), num_parts: None, }; + let config = Config::from_file(&args); + + let _guards = + logging::init_logging(&config, &args.config_path, config.partitioning().num_parts); execute_sim( DummySimCommunicator(), Box::new(TestSubscriber::new_with_events_from_file( "./tests/resources/adhoc_routing/with_updates/expected_events.xml", )), - config_args, + args, ); } @@ -89,13 +94,18 @@ fn execute_adhoc_routing_two_parts_with_updates() { &PathBuf::from("./test_output/simulation/adhoc_routing/with_updates/two_parts/"), ); - let config_args = CommandLineArgs { + let args = CommandLineArgs { config_path: "./tests/resources/adhoc_routing/with_updates/config-2.yml".to_string(), num_parts: None, }; + let config = Config::from_file(&args); + + let _guards = + logging::init_logging(&config, &args.config_path, config.partitioning().num_parts); + execute_sim_with_channels( - config_args, + args, "./tests/resources/adhoc_routing/with_updates/expected_events.xml", ); }