Skip to content
Snippets Groups Projects
Commit d4240220 authored by Alex Crichton's avatar Alex Crichton
Browse files

Update Android images/runners

parent bcbfa856
No related branches found
No related tags found
No related merge requests found
...@@ -29,4 +29,17 @@ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/* ...@@ -29,4 +29,17 @@ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \ ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \ CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
CARGO_TARGET_AARCH64_LINUX_ANDROID_RUNNER=/tmp/runtest \
HOME=/tmp HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
ENTRYPOINT [ \
"bash", \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash emulator @aarch64 -no-window & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
]
...@@ -29,4 +29,17 @@ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/* ...@@ -29,4 +29,17 @@ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \ ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \ CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_RUNNER=/tmp/runtest \
HOME=/tmp HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
ENTRYPOINT [ \
"bash", \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash emulator @arm -no-window & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
]
...@@ -29,4 +29,17 @@ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/* ...@@ -29,4 +29,17 @@ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \ ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \ CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
CARGO_TARGET_I686_LINUX_ANDROID_RUNNER=/tmp/runtest \
HOME=/tmp HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
ENTRYPOINT [ \
"bash", \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash emulator @i686 -no-window -no-accel & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
]
...@@ -14,6 +14,7 @@ run() { ...@@ -14,6 +14,7 @@ run() {
docker run \ docker run \
--user `id -u`:`id -g` \ --user `id -u`:`id -g` \
--rm \ --rm \
--init \
--volume $HOME/.cargo:/cargo \ --volume $HOME/.cargo:/cargo \
$kvm \ $kvm \
--env CARGO_HOME=/cargo \ --env CARGO_HOME=/cargo \
......
...@@ -68,4 +68,4 @@ if [ "$QEMU" != "" ]; then ...@@ -68,4 +68,4 @@ if [ "$QEMU" != "" ]; then
exec grep "^PASSED .* tests" $CARGO_TARGET_DIR/out.log exec grep "^PASSED .* tests" $CARGO_TARGET_DIR/out.log
fi fi
cargo test --manifest-path libc-test/Cargo.toml --target $TARGET exec cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
use std::env;
use std::process::Command;
use std::path::{Path, PathBuf};
fn main() {
assert_eq!(env::args_os().len(), 2);
let test = PathBuf::from(env::args_os().nth(1).unwrap());
let dst = Path::new("/data/local/tmp").join(test.file_name().unwrap());
let status = Command::new("adb")
.arg("wait-for-device")
.status()
.expect("failed to run rumprun-bake");
assert!(status.success());
let status = Command::new("adb")
.arg("push")
.arg(&test)
.arg(&dst)
.status()
.expect("failed to run rumprun-bake");
assert!(status.success());
let output = Command::new("adb")
.arg("shell")
.arg(&dst)
.output()
.expect("failed to run rumprun-bake");
assert!(status.success());
println!("status: {}\nstdout ---\n{}\nstderr ---\n{}",
output.status,
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr));
let stdout = String::from_utf8_lossy(&output.stdout);
let mut lines = stdout.lines().filter(|l| l.starts_with("PASSED "));
if !lines.any(|l| l.contains(" tests")) {
panic!("failed to find successful test run");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment