mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Auto merge of #38729 - alexcrichton:android-steps, r=brson
rustbuild: Add more deps on android-copy-libs The android-copy-libs step is crucial for running tests on the Android target as it copies necessary scripts and such to the emulator. We must run that before running any tests there, but we erroneously only did it for compiletest test suites!
This commit is contained in:
commit
8c547a021e
@ -507,6 +507,10 @@ fn find_tests(dir: &Path,
|
|||||||
pub fn android_copy_libs(build: &Build,
|
pub fn android_copy_libs(build: &Build,
|
||||||
compiler: &Compiler,
|
compiler: &Compiler,
|
||||||
target: &str) {
|
target: &str) {
|
||||||
|
if !target.contains("android") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
println!("Android copy libs to emulator ({})", target);
|
println!("Android copy libs to emulator ({})", target);
|
||||||
build.run(Command::new("adb").arg("remount"));
|
build.run(Command::new("adb").arg("remount"));
|
||||||
build.run(Command::new("adb").args(&["shell", "rm", "-r", ADB_TEST_DIR]));
|
build.run(Command::new("adb").args(&["shell", "rm", "-r", ADB_TEST_DIR]));
|
||||||
|
@ -295,13 +295,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||||||
.dep(|s| s.name("libtest"))
|
.dep(|s| s.name("libtest"))
|
||||||
.dep(|s| s.name("tool-compiletest").target(s.host))
|
.dep(|s| s.name("tool-compiletest").target(s.host))
|
||||||
.dep(|s| s.name("test-helpers"))
|
.dep(|s| s.name("test-helpers"))
|
||||||
.dep(move |s| {
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
if s.target.contains("android") {
|
|
||||||
s.name("android-copy-libs")
|
|
||||||
} else {
|
|
||||||
Step::noop()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.default(mode != "pretty") // pretty tests don't run everywhere
|
.default(mode != "pretty") // pretty tests don't run everywhere
|
||||||
.run(move |s| {
|
.run(move |s| {
|
||||||
check::compiletest(build, &s.compiler(), s.target, mode, dir)
|
check::compiletest(build, &s.compiler(), s.target, mode, dir)
|
||||||
@ -343,6 +337,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||||||
.dep(|s| s.name("tool-compiletest").target(s.host))
|
.dep(|s| s.name("tool-compiletest").target(s.host))
|
||||||
.dep(|s| s.name("test-helpers"))
|
.dep(|s| s.name("test-helpers"))
|
||||||
.dep(|s| s.name("debugger-scripts"))
|
.dep(|s| s.name("debugger-scripts"))
|
||||||
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
.run(move |s| check::compiletest(build, &s.compiler(), s.target,
|
.run(move |s| check::compiletest(build, &s.compiler(), s.target,
|
||||||
"debuginfo-gdb", "debuginfo"));
|
"debuginfo-gdb", "debuginfo"));
|
||||||
}
|
}
|
||||||
@ -386,12 +381,14 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||||||
for (krate, path, _default) in krates("std_shim") {
|
for (krate, path, _default) in krates("std_shim") {
|
||||||
rules.test(&krate.test_step, path)
|
rules.test(&krate.test_step, path)
|
||||||
.dep(|s| s.name("libtest"))
|
.dep(|s| s.name("libtest"))
|
||||||
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
||||||
Mode::Libstd, TestKind::Test,
|
Mode::Libstd, TestKind::Test,
|
||||||
Some(&krate.name)));
|
Some(&krate.name)));
|
||||||
}
|
}
|
||||||
rules.test("check-std-all", "path/to/nowhere")
|
rules.test("check-std-all", "path/to/nowhere")
|
||||||
.dep(|s| s.name("libtest"))
|
.dep(|s| s.name("libtest"))
|
||||||
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
.default(true)
|
.default(true)
|
||||||
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
||||||
Mode::Libstd, TestKind::Test, None));
|
Mode::Libstd, TestKind::Test, None));
|
||||||
@ -400,12 +397,14 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||||||
for (krate, path, _default) in krates("std_shim") {
|
for (krate, path, _default) in krates("std_shim") {
|
||||||
rules.bench(&krate.bench_step, path)
|
rules.bench(&krate.bench_step, path)
|
||||||
.dep(|s| s.name("libtest"))
|
.dep(|s| s.name("libtest"))
|
||||||
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
||||||
Mode::Libstd, TestKind::Bench,
|
Mode::Libstd, TestKind::Bench,
|
||||||
Some(&krate.name)));
|
Some(&krate.name)));
|
||||||
}
|
}
|
||||||
rules.bench("bench-std-all", "path/to/nowhere")
|
rules.bench("bench-std-all", "path/to/nowhere")
|
||||||
.dep(|s| s.name("libtest"))
|
.dep(|s| s.name("libtest"))
|
||||||
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
.default(true)
|
.default(true)
|
||||||
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
||||||
Mode::Libstd, TestKind::Bench, None));
|
Mode::Libstd, TestKind::Bench, None));
|
||||||
@ -413,18 +412,21 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||||||
for (krate, path, _default) in krates("test_shim") {
|
for (krate, path, _default) in krates("test_shim") {
|
||||||
rules.test(&krate.test_step, path)
|
rules.test(&krate.test_step, path)
|
||||||
.dep(|s| s.name("libtest"))
|
.dep(|s| s.name("libtest"))
|
||||||
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
||||||
Mode::Libtest, TestKind::Test,
|
Mode::Libtest, TestKind::Test,
|
||||||
Some(&krate.name)));
|
Some(&krate.name)));
|
||||||
}
|
}
|
||||||
rules.test("check-test-all", "path/to/nowhere")
|
rules.test("check-test-all", "path/to/nowhere")
|
||||||
.dep(|s| s.name("libtest"))
|
.dep(|s| s.name("libtest"))
|
||||||
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
.default(true)
|
.default(true)
|
||||||
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
||||||
Mode::Libtest, TestKind::Test, None));
|
Mode::Libtest, TestKind::Test, None));
|
||||||
for (krate, path, _default) in krates("rustc-main") {
|
for (krate, path, _default) in krates("rustc-main") {
|
||||||
rules.test(&krate.test_step, path)
|
rules.test(&krate.test_step, path)
|
||||||
.dep(|s| s.name("librustc"))
|
.dep(|s| s.name("librustc"))
|
||||||
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
.host(true)
|
.host(true)
|
||||||
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
||||||
Mode::Librustc, TestKind::Test,
|
Mode::Librustc, TestKind::Test,
|
||||||
@ -432,6 +434,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||||||
}
|
}
|
||||||
rules.test("check-rustc-all", "path/to/nowhere")
|
rules.test("check-rustc-all", "path/to/nowhere")
|
||||||
.dep(|s| s.name("librustc"))
|
.dep(|s| s.name("librustc"))
|
||||||
|
.dep(|s| s.name("android-copy-libs"))
|
||||||
.default(true)
|
.default(true)
|
||||||
.host(true)
|
.host(true)
|
||||||
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
.run(move |s| check::krate(build, &s.compiler(), s.target,
|
||||||
|
Loading…
Reference in New Issue
Block a user