File tree Expand file tree Collapse file tree 6 files changed +82
-1
lines changed Expand file tree Collapse file tree 6 files changed +82
-1
lines changed Original file line number Diff line number Diff line change @@ -29,4 +29,17 @@ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
2929
3030ENV PATH=$PATH:/rust/bin \
3131 CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
32+ CARGO_TARGET_AARCH64_LINUX_ANDROID_RUNNER=/tmp/runtest \
3233 HOME=/tmp
34+
35+ ADD runtest-android.rs /tmp/runtest.rs
36+ ENTRYPOINT [ \
37+ "bash" , \
38+ "-c" , \
39+ # set SHELL so android can detect a 64bits system, see
40+ # http://stackoverflow.com/a/41789144
41+ "SHELL=/bin/dash emulator @aarch64 -no-window & \
42+ rustc /tmp/runtest.rs -o /tmp/runtest && \
43+ exec \" $@\" " , \
44+ "--" \
45+ ]
Original file line number Diff line number Diff line change @@ -29,4 +29,17 @@ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
2929
3030ENV PATH=$PATH:/rust/bin \
3131 CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
32+ CARGO_TARGET_ARM_LINUX_ANDROIDEABI_RUNNER=/tmp/runtest \
3233 HOME=/tmp
34+
35+ ADD runtest-android.rs /tmp/runtest.rs
36+ ENTRYPOINT [ \
37+ "bash" , \
38+ "-c" , \
39+ # set SHELL so android can detect a 64bits system, see
40+ # http://stackoverflow.com/a/41789144
41+ "SHELL=/bin/dash emulator @arm -no-window & \
42+ rustc /tmp/runtest.rs -o /tmp/runtest && \
43+ exec \" $@\" " , \
44+ "--" \
45+ ]
Original file line number Diff line number Diff line change @@ -29,4 +29,17 @@ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
2929
3030ENV PATH=$PATH:/rust/bin \
3131 CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
32+ CARGO_TARGET_I686_LINUX_ANDROID_RUNNER=/tmp/runtest \
3233 HOME=/tmp
34+
35+ ADD runtest-android.rs /tmp/runtest.rs
36+ ENTRYPOINT [ \
37+ "bash" , \
38+ "-c" , \
39+ # set SHELL so android can detect a 64bits system, see
40+ # http://stackoverflow.com/a/41789144
41+ "SHELL=/bin/dash emulator @i686 -no-window -no-accel & \
42+ rustc /tmp/runtest.rs -o /tmp/runtest && \
43+ exec \" $@\" " , \
44+ "--" \
45+ ]
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ run() {
1414 docker run \
1515 --user ` id -u` :` id -g` \
1616 --rm \
17+ --init \
1718 --volume $HOME /.cargo:/cargo \
1819 $kvm \
1920 --env CARGO_HOME=/cargo \
Original file line number Diff line number Diff line change @@ -68,4 +68,4 @@ if [ "$QEMU" != "" ]; then
6868 exec grep " ^PASSED .* tests" $CARGO_TARGET_DIR /out.log
6969fi
7070
71- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
71+ exec cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
Original file line number Diff line number Diff line change 1+ use std:: env;
2+ use std:: process:: Command ;
3+ use std:: path:: { Path , PathBuf } ;
4+
5+ fn main ( ) {
6+ assert_eq ! ( env:: args_os( ) . len( ) , 2 ) ;
7+ let test = PathBuf :: from ( env:: args_os ( ) . nth ( 1 ) . unwrap ( ) ) ;
8+ let dst = Path :: new ( "/data/local/tmp" ) . join ( test. file_name ( ) . unwrap ( ) ) ;
9+
10+ let status = Command :: new ( "adb" )
11+ . arg ( "wait-for-device" )
12+ . status ( )
13+ . expect ( "failed to run rumprun-bake" ) ;
14+ assert ! ( status. success( ) ) ;
15+
16+ let status = Command :: new ( "adb" )
17+ . arg ( "push" )
18+ . arg ( & test)
19+ . arg ( & dst)
20+ . status ( )
21+ . expect ( "failed to run rumprun-bake" ) ;
22+ assert ! ( status. success( ) ) ;
23+
24+ let output = Command :: new ( "adb" )
25+ . arg ( "shell" )
26+ . arg ( & dst)
27+ . output ( )
28+ . expect ( "failed to run rumprun-bake" ) ;
29+ assert ! ( status. success( ) ) ;
30+
31+ println ! ( "status: {}\n stdout ---\n {}\n stderr ---\n {}" ,
32+ output. status,
33+ String :: from_utf8_lossy( & output. stdout) ,
34+ String :: from_utf8_lossy( & output. stderr) ) ;
35+
36+ let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
37+ let mut lines = stdout. lines ( ) . filter ( |l| l. starts_with ( "PASSED " ) ) ;
38+ if !lines. any ( |l| l. contains ( " tests" ) ) {
39+ panic ! ( "failed to find successful test run" ) ;
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments