From 9e5f61fcdd29936938d401c0f0055b9af32caf5c Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Wed, 5 Jul 2023 09:54:16 +0100 Subject: [PATCH] Workaround for old android not having echo --- library/std/src/process/tests.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/library/std/src/process/tests.rs b/library/std/src/process/tests.rs index e2c56e634d90..366b591466c0 100644 --- a/library/std/src/process/tests.rs +++ b/library/std/src/process/tests.rs @@ -585,7 +585,14 @@ fn run_canonical_bat_script() { #[test] fn terminate_exited_process() { - let mut p = known_command().arg("hello").spawn().unwrap(); + let mut cmd = if cfg!(target_os = "android") { + let mut p = shell_cmd(); + p.args(&["-c", "true"]); + p + } else { + known_command() + }; + let mut p = cmd.stdout(Stdio::null()).spawn().unwrap(); p.wait().unwrap(); assert!(p.kill().is_ok()); assert!(p.kill().is_ok());