Skip to content

Commit ab7fe9d

Browse files
committed
auto merge of #10458 : yichoi/rust/make_check_pass_android2, r=brson
To enable test on android bot #9120 workcache::test disabled and run-pass/core-run-destroy.rs fixed on android
2 parents 2a984c9 + 68024eb commit ab7fe9d

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

src/etc/adb_run_wrapper.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
# Sometimes android shell produce exitcode "1 : Text File Busy"
66
# Retry after $WAIT seconds, expecting resource cleaned-up
77
WAIT=10
8-
PATH=$1
9-
if [ -d "$PATH" ]
8+
TEST_PATH=$1
9+
BIN_PATH=/system/bin
10+
if [ -d "$TEST_PATH" ]
1011
then
1112
shift
1213
RUN=$1
@@ -17,10 +18,10 @@ then
1718

1819
L_RET=1
1920
L_COUNT=0
20-
cd $PATH
21+
cd $TEST_PATH
2122
while [ $L_RET -eq 1 ]
2223
do
23-
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
24+
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$TEST_PATH PATH=$BIN_PATH:$TEST_PATH $TEST_PATH/$RUN $@ 1>$TEST_PATH/$RUN.stdout 2>$TEST_PATH/$RUN.stderr
2425
L_RET=$?
2526
if [ $L_COUNT -gt 0 ]
2627
then
@@ -30,7 +31,7 @@ then
3031
L_COUNT=$((L_COUNT+1))
3132
done
3233

33-
echo $L_RET > $PATH/$RUN.exitcode
34+
echo $L_RET > $TEST_PATH/$RUN.exitcode
3435

3536
fi
3637
fi

src/libextra/workcache.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ impl<'self, T:Send +
477477

478478

479479
#[test]
480+
#[cfg(not(target_os="android"))] // FIXME(#10455)
480481
fn test() {
481482
use std::{os, run};
482483
use std::io::fs;

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

Lines changed: 12 additions & 2 deletions
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)

src/test/run-pass/x86stdcall.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ pub fn main() {
3333
#[cfg(target_os = "macos")]
3434
#[cfg(target_os = "linux")]
3535
#[cfg(target_os = "freebsd")]
36+
#[cfg(target_os = "android")]
3637
pub fn main() { }

0 commit comments

Comments
 (0)