diff --git a/lib/wasi/src/syscalls/wasi/poll_oneoff.rs b/lib/wasi/src/syscalls/wasi/poll_oneoff.rs index 479051ea6fe..3df45c9c64d 100644 --- a/lib/wasi/src/syscalls/wasi/poll_oneoff.rs +++ b/lib/wasi/src/syscalls/wasi/poll_oneoff.rs @@ -145,7 +145,7 @@ pub(crate) fn poll_oneoff_internal( .filter(|a| a.2.type_ == Eventtype::Clock) .count(); let mut clock_subs: Vec<(SubscriptionClock, u64)> = Vec::with_capacity(subs.len()); - let mut time_to_sleep = None; + let mut time_to_sleep = Duration::ZERO; // First we extract all the subscriptions into an array so that they // can be processed @@ -204,9 +204,9 @@ pub(crate) fn poll_oneoff_internal( // If the timeout duration is zero then this is an immediate check rather than // a sleep itself if clock_info.timeout == 0 { - time_to_sleep = Some(Duration::ZERO); + time_to_sleep = Duration::MAX; } else { - time_to_sleep = Some(Duration::from_nanos(clock_info.timeout)); + time_to_sleep = Duration::from_nanos(clock_info.timeout); clock_subs.push((clock_info, s.userdata)); } continue; @@ -276,19 +276,25 @@ pub(crate) fn poll_oneoff_internal( fd_guards }; - if let Some(time_to_sleep) = time_to_sleep.as_ref() { - if *time_to_sleep == Duration::ZERO { + // If the time is infinite then we omit the time_to_sleep parameter + let asyncify_time = match time_to_sleep { + Duration::ZERO => { Span::current().record("timeout_ns", "nonblocking"); - } else { - Span::current().record("timeout_ns", time_to_sleep.as_millis()); + Some(Duration::ZERO) } - } else { - Span::current().record("timeout_ns", "infinite"); - } + Duration::MAX => { + Span::current().record("timeout_ns", "infinite"); + None + } + time => { + Span::current().record("timeout_ns", time.as_millis()); + Some(time) + } + }; // Block polling the file descriptors let batch = PollBatch::new(pid, tid, &mut guards); - __asyncify(ctx, time_to_sleep, batch)? + __asyncify(ctx, asyncify_time, batch)? }; let mut env = ctx.data(); @@ -303,7 +309,7 @@ pub(crate) fn poll_oneoff_internal( } Err(Errno::Timedout) => { // The timeout has triggerred so lets add that event - if clock_subs.is_empty() && time_to_sleep != Some(Duration::ZERO) { + if clock_subs.is_empty() { tracing::warn!("triggered_timeout (without any clock subscriptions)",); } let mut evts = Vec::new(); @@ -326,7 +332,7 @@ pub(crate) fn poll_oneoff_internal( Ok(Ok(evts)) } // If nonblocking the Errno::Again needs to be turned into an empty list - Err(Errno::Again) if time_to_sleep == Some(Duration::ZERO) => Ok(Ok(Default::default())), + Err(Errno::Again) => Ok(Ok(Default::default())), // Otherwise process the rror Err(err) => Ok(Err(err)), } diff --git a/tests/integration/cli/tests/snapshot.rs b/tests/integration/cli/tests/snapshot.rs index 13606307f11..0c81c29e3ec 100644 --- a/tests/integration/cli/tests/snapshot.rs +++ b/tests/integration/cli/tests/snapshot.rs @@ -36,7 +36,11 @@ pub struct TestSpec { pub use_packages: Vec, pub include_webcs: Vec, pub cli_args: Vec, + #[serde(skip)] pub stdin: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default)] + pub stdin_hash: Option, pub debug_output: bool, pub enable_threads: bool, pub enable_network: bool, @@ -91,6 +95,19 @@ pub struct TestSnapshot { pub result: TestResult, } +impl TestSnapshot { + pub fn convert_stdout_to_hash(&mut self) { + self.result = match &self.result { + TestResult::Success(a) => TestResult::Success(TestOutput { + stdout: format!("hash: {:x}", md5::compute(a.stdout.as_bytes())), + stderr: a.stderr.clone(), + exit_code: a.exit_code, + }), + res => res.clone(), + }; + } +} + pub struct TestBuilder { spec: TestSpec, } @@ -107,6 +124,7 @@ impl TestBuilder { include_webcs: Vec::new(), cli_args: Vec::new(), stdin: None, + stdin_hash: None, debug_output: false, enable_threads: true, enable_network: false, @@ -125,8 +143,14 @@ impl TestBuilder { self } - pub fn stdin_str(mut self, s: impl Into) -> Self { - self.spec.stdin = Some(s.into().into_bytes()); + pub fn stdin_str(self, s: impl Into) -> Self { + let str = s.into(); + self.stdin(str.as_bytes()) + } + + pub fn stdin(mut self, s: &[u8]) -> Self { + self.spec.stdin_hash = Some(format!("{:x}", md5::compute(s))); + self.spec.stdin = Some(s.to_vec()); self } @@ -478,6 +502,38 @@ fn test_snapshot_execve() { assert_json_snapshot!(snapshot); } +#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))] +#[test] +fn test_snapshot_minimodem_tx() { + let mut snapshot = TestBuilder::new() + .with_name(function!()) + .stdin_str("This message wont get through") + .arg("--tx") + .arg("--tx-carrier") + .arg("--stdio") + .arg("--float-samples") + .arg("same") + .run_wasm(include_bytes!("./wasm/minimodem.wasm")); + snapshot.convert_stdout_to_hash(); + + assert_json_snapshot!(snapshot); +} + +#[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))] +#[test] +fn test_snapshot_minimodem_rx() { + let snapshot = TestBuilder::new() + .with_name(function!()) + .arg("--rx") + .arg("--tx-carrier") + .arg("--stdio") + .arg("--float-samples") + .arg("same") + .stdin(include_bytes!("./wasm/minimodem.data")) + .run_wasm(include_bytes!("./wasm/minimodem.wasm")); + assert_json_snapshot!(snapshot); +} + #[cfg(not(any(target_env = "musl", target_os = "macos", target_os = "windows")))] #[test] fn test_snapshot_web_server() { diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_bash.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_bash.snap index d29d4a46db7..28bee404e60 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_bash.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_bash.snap @@ -18,40 +18,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 47, - 98, - 105, - 110, - 47, - 98, - 97, - 115, - 104, - 10, - 101, - 99, - 104, - 111, - 32, - 104, - 105, - 10, - 101, - 120, - 105, - 116, - 10, - 101, - 99, - 104, - 111, - 32, - 104, - 105, - 50, - 10 - ], + "stdin_hash": "eb83da76ee5fbab28288ecf6385c69db", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_dash.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_dash.snap index 48f086210f0..e478e2fb501 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_dash.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_dash.snap @@ -18,36 +18,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 47, - 98, - 105, - 110, - 47, - 100, - 97, - 115, - 104, - 10, - 101, - 99, - 104, - 111, - 32, - 104, - 105, - 10, - 101, - 120, - 105, - 116, - 10, - 101, - 120, - 105, - 116, - 10 - ], + "stdin_hash": "702da725f176c20024965c8830b620ae", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_echo.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_echo.snap index 892da5b1649..2afe70af1f6 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_echo.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_echo.snap @@ -8,19 +8,7 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": [ - 101, - 99, - 104, - 111, - 32, - 104, - 101, - 108, - 108, - 111, - 10 - ], + "stdin_hash": "664d0430ee33458602e580520841a2d4", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_ls.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_ls.snap index 1d688eb6419..fd203b50344 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_ls.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_ls.snap @@ -15,16 +15,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 108, - 115, - 10, - 101, - 120, - 105, - 116, - 10 - ], + "stdin_hash": "ceb5d83a0368a10c813f8e05c42a3a7d", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_pipe.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_pipe.snap index 2f8dd8607ed..f66a3777626 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_pipe.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_pipe.snap @@ -15,30 +15,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 101, - 99, - 104, - 111, - 32, - 104, - 101, - 108, - 108, - 111, - 32, - 124, - 32, - 99, - 97, - 116, - 10, - 101, - 120, - 105, - 116, - 10 - ], + "stdin_hash": "d83523479d9f84e9f94230d5aed27347", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_python.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_python.snap index 8ecc184c455..9cceb75488c 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_python.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_bash_python.snap @@ -18,56 +18,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 119, - 97, - 115, - 109, - 101, - 114, - 32, - 114, - 117, - 110, - 32, - 115, - 121, - 114, - 117, - 115, - 97, - 107, - 98, - 97, - 114, - 121, - 47, - 112, - 121, - 116, - 104, - 111, - 110, - 32, - 45, - 45, - 32, - 45, - 99, - 32, - 39, - 112, - 114, - 105, - 110, - 116, - 40, - 49, - 48, - 41, - 39, - 10 - ], + "stdin_hash": "bda2b0db976f1724ef16ae1491211d52", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_catsay.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_catsay.snap index b37f4e4447e..f0cabeb39a1 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_catsay.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_catsay.snap @@ -8,15 +8,7 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": [ - 109, - 101, - 111, - 111, - 111, - 119, - 119 - ], + "stdin_hash": "ed17ce0ab9af325cceb217a26ee9b8a1", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_condvar.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_condvar.snap index f58d950e827..1498588ed76 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_condvar.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_condvar.snap @@ -8,7 +8,6 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": null, "debug_output": true, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_cowsay.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_cowsay.snap index cec88387447..d9c328ed373 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_cowsay.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_cowsay.snap @@ -8,13 +8,7 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": [ - 98, - 108, - 97, - 104, - 10 - ], + "stdin_hash": "0d599f0ec05c3bda8c3b8a68c32a1b47", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_bash.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_bash.snap index 403bda5a745..ef449c3ae00 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_bash.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_bash.snap @@ -18,36 +18,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 47, - 98, - 105, - 110, - 47, - 98, - 97, - 115, - 104, - 10, - 101, - 99, - 104, - 111, - 32, - 104, - 105, - 10, - 101, - 120, - 105, - 116, - 10, - 101, - 120, - 105, - 116, - 10 - ], + "stdin_hash": "31837f6a5667cb17dd97f274b20281bb", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dash.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dash.snap index 7e46eb51574..1e9ada84624 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dash.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dash.snap @@ -18,36 +18,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 47, - 98, - 105, - 110, - 47, - 100, - 97, - 115, - 104, - 10, - 101, - 99, - 104, - 111, - 32, - 104, - 105, - 10, - 101, - 120, - 105, - 116, - 10, - 101, - 120, - 105, - 116, - 10 - ], + "stdin_hash": "702da725f176c20024965c8830b620ae", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dev_urandom.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dev_urandom.snap index 3f97603037d..7b310a5230a 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dev_urandom.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dev_urandom.snap @@ -15,39 +15,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 104, - 101, - 97, - 100, - 32, - 45, - 99, - 32, - 49, - 48, - 32, - 47, - 100, - 101, - 118, - 47, - 117, - 114, - 97, - 110, - 100, - 111, - 109, - 32, - 124, - 32, - 119, - 99, - 32, - 45, - 99 - ], + "stdin_hash": "80a57e78213b40607259d3909a44b0cf", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dev_zero.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dev_zero.snap index 9aae839fe1b..9f3beef9388 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dev_zero.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_dev_zero.snap @@ -15,28 +15,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 104, - 101, - 97, - 100, - 32, - 45, - 99, - 32, - 49, - 48, - 32, - 47, - 100, - 101, - 118, - 47, - 122, - 101, - 114, - 111 - ], + "stdin_hash": "a911ff36e7a2d67baba7c3dcb45ac5c9", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_echo.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_echo.snap index aef5c929c58..40bea2ef5d4 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_echo.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_echo.snap @@ -8,14 +8,7 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": [ - 101, - 99, - 104, - 111, - 32, - 50 - ], + "stdin_hash": "f21e64a91c2b4c628da60b9a6ef26c46", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_echo_to_cat.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_echo_to_cat.snap index 53782128179..648a9c66407 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_echo_to_cat.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_echo_to_cat.snap @@ -15,24 +15,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 101, - 99, - 104, - 111, - 32, - 104, - 101, - 108, - 108, - 111, - 32, - 124, - 32, - 99, - 97, - 116 - ], + "stdin_hash": "4a75babacd4e06efe6c6594a2864f61f", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_python.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_python.snap index a090e6c8c17..021d098f221 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_python.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_dash_python.snap @@ -18,55 +18,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 119, - 97, - 115, - 109, - 101, - 114, - 32, - 114, - 117, - 110, - 32, - 115, - 121, - 114, - 117, - 115, - 97, - 107, - 98, - 97, - 114, - 121, - 47, - 112, - 121, - 116, - 104, - 111, - 110, - 32, - 45, - 45, - 32, - 45, - 99, - 32, - 39, - 112, - 114, - 105, - 110, - 116, - 40, - 49, - 48, - 41, - 39 - ], + "stdin_hash": "56c581e32481cdbf1d70227f3c4b1a84", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_default_file_system_tree.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_default_file_system_tree.snap index 52eddd561d5..9e8be647aea 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_default_file_system_tree.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_default_file_system_tree.snap @@ -10,7 +10,6 @@ expression: snapshot "cli_args": [ "ls" ], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_epoll.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_epoll.snap index 076d584e5f9..de334a78d9c 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_epoll.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_epoll.snap @@ -1,6 +1,6 @@ --- source: tests/integration/cli/tests/snapshot.rs -assertion_line: 363 +assertion_line: 466 expression: snapshot --- { @@ -9,7 +9,6 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_execve.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_execve.snap index 00deec631dc..45723256eb6 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_execve.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_execve.snap @@ -15,7 +15,6 @@ expression: snapshot } ], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_file_copy.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_file_copy.snap index 6d2791c7f8a..c4b7d09202d 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_file_copy.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_file_copy.snap @@ -18,10 +18,7 @@ expression: snapshot "/dev/stdin", "/dev/stdout" ], - "stdin": [ - 104, - 105 - ], + "stdin_hash": "49f68a5c8493ec2c0bf489821c21fc3b", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_fork.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_fork.snap index 61b794ff7a6..da92ed84112 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_fork.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_fork.snap @@ -14,7 +14,6 @@ expression: snapshot } ], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_fork_and_exec.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_fork_and_exec.snap index 6c69a9f3ddd..047af398289 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_fork_and_exec.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_fork_and_exec.snap @@ -14,7 +14,6 @@ expression: snapshot } ], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump.snap index 09ce0a8f0e2..23f04c937ac 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump.snap @@ -14,7 +14,6 @@ expression: snapshot } ], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump2.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump2.snap index 761a1e59938..6cecd4fadb5 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump2.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump2.snap @@ -14,7 +14,6 @@ expression: snapshot } ], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump_fork.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump_fork.snap index 4eaa2ea17dc..8585a2ebaeb 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump_fork.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_longjump_fork.snap @@ -8,7 +8,6 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_minimodem_rx.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_minimodem_rx.snap new file mode 100644 index 00000000000..55ccd72a26a --- /dev/null +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_minimodem_rx.snap @@ -0,0 +1,30 @@ +--- +source: tests/integration/cli/tests/snapshot.rs +assertion_line: 499 +expression: snapshot +--- +{ + "spec": { + "name": "snapshot::test_snapshot_minimodem_rx", + "use_packages": [], + "include_webcs": [], + "cli_args": [ + "--rx", + "--tx-carrier", + "--stdio", + "--float-samples", + "same" + ], + "stdin_hash": "eeaf940b4ae9db7eb9a4f45a24989a57", + "debug_output": false, + "enable_threads": true, + "enable_network": false + }, + "result": { + "Success": { + "stdout": "This message wont get through\n", + "stderr": "### CARRIER 521 @ 2083.3 Hz ###\n\n### NOCARRIER ndata=46 confidence=140169.578 ampl=45.976 bps=521.03 (0.0% fast) ###\n", + "exit_code": 0 + } + } +} diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_minimodem_tx.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_minimodem_tx.snap new file mode 100644 index 00000000000..ce3b46f334f --- /dev/null +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_minimodem_tx.snap @@ -0,0 +1,30 @@ +--- +source: tests/integration/cli/tests/snapshot.rs +assertion_line: 519 +expression: snapshot +--- +{ + "spec": { + "name": "snapshot::test_snapshot_minimodem_tx", + "use_packages": [], + "include_webcs": [], + "cli_args": [ + "--tx", + "--tx-carrier", + "--stdio", + "--float-samples", + "same" + ], + "stdin_hash": "efbbebc40e07bc2365088f9506f8a5d1", + "debug_output": false, + "enable_threads": true, + "enable_network": false + }, + "result": { + "Success": { + "stdout": "hash: 50e55400b51b975eab31f31cb07419fd", + "stderr": "", + "exit_code": 0 + } + } +} diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_multithreading.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_multithreading.snap index da0751a6add..bc183c818a3 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_multithreading.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_multithreading.snap @@ -8,7 +8,6 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": null, "debug_output": true, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_pipes.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_pipes.snap index ae9f3e6e3c1..d725ddc2450 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_pipes.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_pipes.snap @@ -14,7 +14,6 @@ expression: snapshot } ], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_process_spawn.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_process_spawn.snap index a7eab67a4d9..c3a1e43b81b 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_process_spawn.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_process_spawn.snap @@ -14,7 +14,6 @@ expression: snapshot } ], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_quickjs.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_quickjs.snap index 4d7cb7a4f4c..7e741056287 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_quickjs.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_quickjs.snap @@ -8,23 +8,7 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": [ - 112, - 114, - 105, - 110, - 116, - 40, - 50, - 43, - 50, - 41, - 59, - 10, - 92, - 113, - 10 - ], + "stdin_hash": "7b1ec18c69fb609403f75c6e673f2d33", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_signals.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_signals.snap index 7810ad28db4..5afbc9b4449 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_signals.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_signals.snap @@ -9,7 +9,6 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_sleep.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_sleep.snap index 8b7eaff0ea1..175d6d79392 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_sleep.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_sleep.snap @@ -8,7 +8,6 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_stdin_stdout_stderr.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_stdin_stdout_stderr.snap index 14e0b0a4e41..da1007772d7 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_stdin_stdout_stderr.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_stdin_stdout_stderr.snap @@ -11,12 +11,7 @@ expression: snapshot "tee", "/dev/stderr" ], - "stdin": [ - 98, - 108, - 97, - 104 - ], + "stdin_hash": "6f1ed002ab5595859014ebf0951522d9", "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_thread_locals.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_thread_locals.snap index 17041482d40..0dcb8fee24c 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_thread_locals.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_thread_locals.snap @@ -8,7 +8,6 @@ expression: snapshot "use_packages": [], "include_webcs": [], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_vfork.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_vfork.snap index 4a0d8de7685..f78e8083eff 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_vfork.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_vfork.snap @@ -14,7 +14,6 @@ expression: snapshot } ], "cli_args": [], - "stdin": null, "debug_output": false, "enable_threads": true, "enable_network": false diff --git a/tests/integration/cli/tests/snapshots/snapshot__snapshot_web_server.snap b/tests/integration/cli/tests/snapshots/snapshot__snapshot_web_server.snap index 7e2eff9f72c..4596b492172 100644 --- a/tests/integration/cli/tests/snapshots/snapshot__snapshot_web_server.snap +++ b/tests/integration/cli/tests/snapshots/snapshot__snapshot_web_server.snap @@ -22,141 +22,7 @@ expression: snapshot } ], "cli_args": [], - "stdin": [ - 10, - 99, - 97, - 116, - 32, - 47, - 112, - 117, - 98, - 108, - 105, - 99, - 47, - 109, - 97, - 105, - 110, - 46, - 106, - 115, - 32, - 124, - 32, - 119, - 99, - 32, - 45, - 99, - 32, - 62, - 32, - 47, - 112, - 117, - 98, - 108, - 105, - 99, - 47, - 109, - 97, - 105, - 110, - 46, - 106, - 115, - 46, - 115, - 105, - 122, - 101, - 10, - 114, - 109, - 32, - 45, - 102, - 32, - 47, - 99, - 102, - 103, - 47, - 99, - 111, - 110, - 102, - 105, - 103, - 46, - 116, - 111, - 109, - 108, - 10, - 47, - 98, - 105, - 110, - 47, - 119, - 101, - 98, - 115, - 101, - 114, - 118, - 101, - 114, - 32, - 45, - 45, - 108, - 111, - 103, - 45, - 108, - 101, - 118, - 101, - 108, - 32, - 119, - 97, - 114, - 110, - 32, - 45, - 45, - 114, - 111, - 111, - 116, - 32, - 47, - 112, - 117, - 98, - 108, - 105, - 99, - 32, - 45, - 45, - 112, - 111, - 114, - 116, - 32, - 55, - 55, - 55, - 55 - ], + "stdin_hash": "5341c172edb6109ca9aa44b67adc2eeb", "debug_output": false, "enable_threads": true, "enable_network": true diff --git a/tests/integration/cli/tests/wasm/minimodem.data b/tests/integration/cli/tests/wasm/minimodem.data new file mode 100644 index 00000000000..45196562019 Binary files /dev/null and b/tests/integration/cli/tests/wasm/minimodem.data differ diff --git a/tests/integration/cli/tests/wasm/minimodem.wasm b/tests/integration/cli/tests/wasm/minimodem.wasm new file mode 100644 index 00000000000..83bcf0bec1c Binary files /dev/null and b/tests/integration/cli/tests/wasm/minimodem.wasm differ