Skip to content

Commit c45870b

Browse files
committed
fix #10450
1 parent 8883138 commit c45870b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/test/run-pass/core-run-destroy.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,23 @@ use std::io;
2222

2323
#[test]
2424
fn test_destroy_once() {
25-
let mut p = run::Process::new("echo", [], run::ProcessOptions::new());
25+
#[cfg(not(target_os="android"))]
26+
static PROG: &'static str = "echo";
27+
#[cfg(target_os="android")]
28+
static PROG: &'static str = "ls"; // android don't have echo binary
29+
30+
let mut p = run::Process::new(PROG, [], run::ProcessOptions::new());
2631
p.destroy(); // this shouldn't crash (and nor should the destructor)
2732
}
2833

2934
#[test]
3035
fn test_destroy_twice() {
31-
let mut p = run::Process::new("echo", [], run::ProcessOptions::new());
36+
#[cfg(not(target_os="android"))]
37+
static PROG: &'static str = "echo";
38+
#[cfg(target_os="android")]
39+
static PROG: &'static str = "ls"; // android don't have echo binary
40+
41+
let mut p = run::Process::new(PROG, [], run::ProcessOptions::new());
3242
p.destroy(); // this shouldnt crash...
3343
do io::io_error::cond.trap(|_| {}).inside {
3444
p.destroy(); // ...and nor should this (and nor should the destructor)

0 commit comments

Comments
 (0)