aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorThiƩbaud Weksteen <tweek@google.com>2021-04-13 17:00:18 +0200
committerThiƩbaud Weksteen <tweek@google.com>2021-04-13 17:06:56 +0200
commit8fe8d38b50c3aa13a0e3906c1edda69f8c5e0bc1 (patch)
tree145cd4e1b3c7e876a65031f30f607360690369ac /src/lib.rs
parentb17443424063f0c181060fa83a9ed45c1eec58ed (diff)
downloadshared_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.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index ee77aa4..58c1e0c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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)");