Change:
To enable test on android bot and test/run-pass/rtio- It looks to me RtioProcess does not work properly on android.
logs are
Hm this may be an FFI issue with libuv. I realized during my uv rewrite that libuv is giving us an int64t exit status and we think it's a cint. Once lands this may be fixed.
Hmm, this issue number has propagated to several more tests that are cfg-disabled on android. (Some of which are now failing when I mixed in a Boehm/BDW conservative GC into the runtime, in particular .)
Also, has landed, so it would be good to determine if these tests now work on Android.
Triage: I have no idea how to test this, but a lot has changed in a year (especially the removal of green & libuv), so these may be magically fixed; if someone can check.
Triage: is gone, but all these tests in are still ignored for android.
I tried to run these tests with but they all failed with , which seems suspect (at least for the tests that invoke , , , etc.). Is there a better way to test? I have an android device available.

Discussion:
use crate::io::ErrorKind; use crate::str; <del> // FIXME(#10380) these tests should not all be ignored on android. </del> <ins> #[cfg(target_os = "android")] fn shell_cmd() -> Command { Command::new("/system/bin/sh") } #[cfg(not(target_os = "android"))] fn shell_cmd() -> Command { Command::new("/bin/sh") } </ins> #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn smoke() { let p = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "exit 0"]).spawn() } else { <del> Command::new("true").spawn() </del> <ins> shell_cmd().arg("-c").arg("true").spawn() </ins> }; assert!(p.is_ok()); let mut p = p.unwrap();

} #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn exit_reported_right() { let p = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "exit 1"]).spawn() } else { <del> Command::new("false").spawn() </del> <ins> shell_cmd().arg("-c").arg("false").spawn() </ins> }; assert!(p.is_ok()); let mut p = p.unwrap();

#[test] #[cfg(unix)] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn signal_reported_right() { use crate::os::unix::process::ExitStatusExt; <del> let mut p = Command::new("/bin/sh").arg("-c").arg("read a").stdin(Stdio::piped()).spawn().unwrap(); </del> <ins> let mut p = shell_cmd().arg("-c").arg("read a").stdin(Stdio::piped()).spawn().unwrap(); </ins> p.kill().unwrap(); match p.wait().unwrap().signal() { Some(9) => {}

} #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn stdout_works() { if cfg!(target_os = "windows") { let mut cmd = Command::new("cmd"); cmd.args(&["/C", "echo foobar"]).stdout(Stdio::piped()); assert_eq!(run_output(cmd), "foobarrn"); } else { <del> let mut cmd = Command::new("echo"); cmd.arg("foobar").stdout(Stdio::piped()); </del> <ins> let mut cmd = shell_cmd(); cmd.arg("-c").arg("echo foobar").stdout(Stdio::piped()); </ins> assert_eq!(run_output(cmd), "foobarn"); } } #[test] <del> #[cfg_attr(any(windows, target_os = "android", target_os = "vxworks"), ignore)] </del> <ins> #[cfg_attr(any(windows, target_os = "vxworks"), ignore)] </ins> fn set_current_dir_works() { <del> let mut cmd = Command::new("/bin/sh"); </del> <ins> let mut cmd = shell_cmd(); </ins> cmd.arg("-c").arg("pwd").current_dir("/").stdout(Stdio::piped()); assert_eq!(run_output(cmd), "/n"); } #[test] <del> #[cfg_attr(any(windows, target_os = "android", target_os = "vxworks"), ignore)] </del> <ins> #[cfg_attr(any(windows, target_os = "vxworks"), ignore)] </ins> fn stdin_works() { <del> let mut p = Command::new("/bin/sh") </del> <ins> let mut p = shell_cmd() </ins> .arg("-c") .arg("read line; echo $line") .stdin(Stdio::piped())

} #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn test_process_status() { let mut status = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "exit 1"]).status().unwrap() } else { <del> Command::new("false").status().unwrap() </del> <ins> shell_cmd().arg("-c").arg("false").status().unwrap() </ins> }; assert!(status.code() == Some(1)); status = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "exit 0"]).status().unwrap() } else { <del> Command::new("true").status().unwrap() </del> <ins> shell_cmd().arg("-c").arg("true").status().unwrap() </ins> }; assert!(status.success()); }

} #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn test_process_output_output() { let Output { status, stdout, stderr } = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "echo hello"]).output().unwrap() } else { <del> Command::new("echo").arg("hello").output().unwrap() </del> <ins> shell_cmd().arg("-c").arg("echo hello").output().unwrap() </ins> }; let output_str = str::from_utf8(&stdout).unwrap();

} #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn test_process_output_error() { let Output { status, stdout, stderr } = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "mkdir ."]).output().unwrap()

Command::new("mkdir").arg("./").output().unwrap() }; <del> assert!(status.code() == Some(1)); </del> <ins> assert!(status.code().is_some()); assert!(status.code() != Some(0)); </ins> assert_eq!(stdout, Vec::new()); assert!(!stderr.is_empty()); } #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn test_finish_once() { let mut prog = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "exit 1"]).spawn().unwrap() } else { <del> Command::new("false").spawn().unwrap() </del> <ins> shell_cmd().arg("-c").arg("false").spawn().unwrap() </ins> }; assert!(prog.wait().unwrap().code() == Some(1)); } #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn test_finish_twice() { let mut prog = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "exit 1"]).spawn().unwrap() } else { <del> Command::new("false").spawn().unwrap() </del> <ins> shell_cmd().arg("-c").arg("false").spawn().unwrap() </ins> }; assert!(prog.wait().unwrap().code() == Some(1)); assert!(prog.wait().unwrap().code() == Some(1)); } #[test] <del> #[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)] </del> <ins> #[cfg_attr(any(target_os = "vxworks"), ignore)] </ins> fn test_wait_with_output_once() { let prog = if cfg!(target_os = "windows") { Command::new("cmd").args(&["/C", "echo hello"]).stdout(Stdio::piped()).spawn().unwrap() } else { <del> Command::new("echo").arg("hello").stdout(Stdio::piped()).spawn().unwrap() </del> <ins> shell_cmd().arg("-c").arg("echo hello").stdout(Stdio::piped()).spawn().unwrap() </ins> }; let Output { status, stdout, stderr } = prog.wait_with_output().unwrap();