diff --git a/src/runtime2/tests/mod.rs b/src/runtime2/tests/mod.rs index 138fccfa2ee5e323b3348452eec5069438a1044b..6baa362a0c2dd9fc572b89a4c7b005151ed2f6ac 100644 --- a/src/runtime2/tests/mod.rs +++ b/src/runtime2/tests/mod.rs @@ -5,13 +5,13 @@ use crate::runtime2::component::{CompCtx, CompPDL}; mod error_handling; +const LOG_LEVEL: LogLevel = LogLevel::Debug; const NUM_THREADS: u32 = 4; -const DEBUG_LOGGING: bool = true; pub(crate) fn compile_and_create_component(source: &str, routine_name: &str, args: ValueGroup) { let protocol = ProtocolDescription::parse(source.as_bytes()) .expect("successful compilation"); - let runtime = Runtime::new(NUM_THREADS, DEBUG_LOGGING, protocol) + let runtime = Runtime::new(NUM_THREADS, LOG_LEVEL, protocol) .expect("successful runtime startup"); create_component(&runtime, "", routine_name, args); } @@ -37,7 +37,7 @@ fn test_component_creation() { auto b = 5 + a; } ").expect("compilation"); - let rt = Runtime::new(1, true, pd).unwrap(); + let rt = Runtime::new(1, LOG_LEVEL, pd).unwrap(); for _i in 0..20 { create_component(&rt, "", "nothing_at_all", no_args()); @@ -94,7 +94,7 @@ fn test_component_communication() { new sender(o_mrmm, 5, 5); new receiver(i_mrmm, 5, 5); }").expect("compilation"); - let rt = Runtime::new(3, true, pd).unwrap(); + let rt = Runtime::new(3, LOG_LEVEL, pd).unwrap(); create_component(&rt, "", "constructor", no_args()); } @@ -143,7 +143,7 @@ fn test_intermediate_messenger() { new constructor_template(); } ").expect("compilation"); - let rt = Runtime::new(3, true, pd).unwrap(); + let rt = Runtime::new(3, LOG_LEVEL, pd).unwrap(); create_component(&rt, "", "constructor", no_args()); } @@ -193,7 +193,7 @@ fn test_simple_select() { new sender(tx_b, num_sends); } ").expect("compilation"); - let rt = Runtime::new(3, true, pd).unwrap(); + let rt = Runtime::new(3, LOG_LEVEL, pd).unwrap(); create_component(&rt, "", "constructor", no_args()); } @@ -215,7 +215,7 @@ fn test_unguarded_select() { } } ").expect("compilation"); - let rt = Runtime::new(3, false, pd).unwrap(); + let rt = Runtime::new(3, LOG_LEVEL, pd).unwrap(); create_component(&rt, "", "constructor_outside_select", no_args()); create_component(&rt, "", "constructor_inside_select", no_args()); } @@ -231,7 +231,7 @@ fn test_empty_select() { } } ").expect("compilation"); - let rt = Runtime::new(3, false, pd).unwrap(); + let rt = Runtime::new(3, LOG_LEVEL, pd).unwrap(); create_component(&rt, "", "constructor", no_args()); } @@ -257,7 +257,7 @@ fn test_random_u32_temporary_thingo() { new random_taker(rx, num_values); } ").expect("compilation"); - let rt = Runtime::new(1, true, pd).unwrap(); + let rt = Runtime::new(1, LOG_LEVEL, pd).unwrap(); create_component(&rt, "", "constructor", no_args()); } @@ -387,6 +387,6 @@ fn test_sending_receiving_union() { new client(cmd_tx, data_rx, num_rounds); } ").expect("compilation"); - let rt = Runtime::new(1, false, pd).unwrap(); + let rt = Runtime::new(1, LOG_LEVEL, pd).unwrap(); create_component(&rt, "", "main", no_args()); } \ No newline at end of file