From c45870b85e9183a31ab0a0a8a3841977f5f2615f Mon Sep 17 00:00:00 2001 From: Young-il Choi Date: Fri, 15 Nov 2013 08:34:54 +0900 Subject: [PATCH] fix #10450 --- src/test/run-pass/core-run-destroy.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/test/run-pass/core-run-destroy.rs b/src/test/run-pass/core-run-destroy.rs index 4a224fd52c9..a24d11a89b0 100644 --- a/src/test/run-pass/core-run-destroy.rs +++ b/src/test/run-pass/core-run-destroy.rs @@ -22,13 +22,23 @@ use std::io; #[test] fn test_destroy_once() { - let mut p = run::Process::new("echo", [], run::ProcessOptions::new()); + #[cfg(not(target_os="android"))] + static PROG: &'static str = "echo"; + #[cfg(target_os="android")] + static PROG: &'static str = "ls"; // android don't have echo binary + + let mut p = run::Process::new(PROG, [], run::ProcessOptions::new()); p.destroy(); // this shouldn't crash (and nor should the destructor) } #[test] fn test_destroy_twice() { - let mut p = run::Process::new("echo", [], run::ProcessOptions::new()); + #[cfg(not(target_os="android"))] + static PROG: &'static str = "echo"; + #[cfg(target_os="android")] + static PROG: &'static str = "ls"; // android don't have echo binary + + let mut p = run::Process::new(PROG, [], run::ProcessOptions::new()); p.destroy(); // this shouldnt crash... do io::io_error::cond.trap(|_| {}).inside { p.destroy(); // ...and nor should this (and nor should the destructor)