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:
Peter Collingbourne 2022-10-05 19:07:12 -07:00
parent c97d02cdb5
commit 9a1c1c7941
3 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@
use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var, output, t};
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.
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, PartialOrd, Ord)]

View File

@ -93,7 +93,7 @@ fn start_android_emulator(server: &Path) {
println!("pushing server");
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());
println!("forwarding tcp");
@ -102,7 +102,7 @@ fn start_android_emulator(server: &Path) {
assert!(status.success());
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) {

View File

@ -98,7 +98,7 @@ fn main() {
let listener = t!(TcpListener::bind(config.bind));
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 {
let mut work_dir = env::temp_dir();
work_dir.push("work");