tools/remote-test-{server,client}: Use /data/local/tmp on Android
The /data/tmp directory does not exist, at least not on recent versions of Android, which currently leads to test failures on that platform. I checked a virtual device running AOSP master and a Nexus 5 running Android Marshmallow and on both devices the /data/tmp directory does not exist and /data/local/tmp does, so let's switch to /data/local/tmp.
This commit is contained in:
parent
c97d02cdb5
commit
9a1c1c7941
@ -23,7 +23,7 @@
|
|||||||
use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var, output, t};
|
use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var, output, t};
|
||||||
use crate::{envify, CLang, DocTests, GitRepo, Mode};
|
use crate::{envify, CLang, DocTests, GitRepo, Mode};
|
||||||
|
|
||||||
const ADB_TEST_DIR: &str = "/data/tmp/work";
|
const ADB_TEST_DIR: &str = "/data/local/tmp/work";
|
||||||
|
|
||||||
/// The two modes of the test runner; tests or benchmarks.
|
/// The two modes of the test runner; tests or benchmarks.
|
||||||
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, PartialOrd, Ord)]
|
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, PartialOrd, Ord)]
|
||||||
|
@ -93,7 +93,7 @@ fn start_android_emulator(server: &Path) {
|
|||||||
|
|
||||||
println!("pushing server");
|
println!("pushing server");
|
||||||
let status =
|
let status =
|
||||||
Command::new("adb").arg("push").arg(server).arg("/data/tmp/testd").status().unwrap();
|
Command::new("adb").arg("push").arg(server).arg("/data/local/tmp/testd").status().unwrap();
|
||||||
assert!(status.success());
|
assert!(status.success());
|
||||||
|
|
||||||
println!("forwarding tcp");
|
println!("forwarding tcp");
|
||||||
@ -102,7 +102,7 @@ fn start_android_emulator(server: &Path) {
|
|||||||
assert!(status.success());
|
assert!(status.success());
|
||||||
|
|
||||||
println!("executing server");
|
println!("executing server");
|
||||||
Command::new("adb").arg("shell").arg("/data/tmp/testd").spawn().unwrap();
|
Command::new("adb").arg("shell").arg("/data/local/tmp/testd").spawn().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_rootfs(target: &str, rootfs: &Path, server: &Path, rootfs_img: &Path) {
|
fn prepare_rootfs(target: &str, rootfs: &Path, server: &Path, rootfs_img: &Path) {
|
||||||
|
@ -98,7 +98,7 @@ fn main() {
|
|||||||
|
|
||||||
let listener = t!(TcpListener::bind(config.bind));
|
let listener = t!(TcpListener::bind(config.bind));
|
||||||
let (work, tmp): (PathBuf, PathBuf) = if cfg!(target_os = "android") {
|
let (work, tmp): (PathBuf, PathBuf) = if cfg!(target_os = "android") {
|
||||||
("/data/tmp/work".into(), "/data/tmp/work/tmp".into())
|
("/data/local/tmp/work".into(), "/data/local/tmp/work/tmp".into())
|
||||||
} else {
|
} else {
|
||||||
let mut work_dir = env::temp_dir();
|
let mut work_dir = env::temp_dir();
|
||||||
work_dir.push("work");
|
work_dir.push("work");
|
||||||
|
Loading…
Reference in New Issue
Block a user