diff options
author | ThiƩbaud Weksteen <tweek@google.com> | 2021-04-13 17:00:18 +0200 |
---|---|---|
committer | ThiƩbaud Weksteen <tweek@google.com> | 2021-04-13 17:06:56 +0200 |
commit | 8fe8d38b50c3aa13a0e3906c1edda69f8c5e0bc1 (patch) | |
tree | 145cd4e1b3c7e876a65031f30f607360690369ac /src/lib.rs | |
parent | b17443424063f0c181060fa83a9ed45c1eec58ed (diff) | |
download | shared_child-8fe8d38b50c3aa13a0e3906c1edda69f8c5e0bc1.tar.gz |
Update shared_child to 0.3.5
Test: atest shared_child_device_test_src_lib
Bug: 185227802
Change-Id: Ib91ac30786acc82256b68954c13d6b3b70047ea4
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -222,7 +222,7 @@ enum ChildState { Exited(ExitStatus), } -use ChildState::*; +use crate::ChildState::*; #[cfg(test)] mod tests { @@ -231,12 +231,27 @@ mod tests { use std::process::Command; use std::sync::Arc; + // Python isn't available on some Unix platforms, e.g. Android, so we need this instead. + #[cfg(unix)] + pub fn true_cmd() -> Command { + Command::new("true") + } + + #[cfg(not(unix))] pub fn true_cmd() -> Command { let mut cmd = Command::new("python"); cmd.arg("-c").arg(""); cmd } + #[cfg(unix)] + pub fn sleep_forever_cmd() -> Command { + let mut cmd = Command::new("sleep"); + cmd.arg("1000000"); + cmd + } + + #[cfg(not(unix))] pub fn sleep_forever_cmd() -> Command { let mut cmd = Command::new("python"); cmd.arg("-c").arg("import time; time.sleep(1000000)"); |