blob: e5b666ab3b6890bc36415b40d373c6b14a1dd7a1 [file] [log] [blame]
Alex Crichtondefd1b32016-03-08 07:15:551// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
Alex Crichtonf72bfe62016-05-02 22:16:1511//! Implementation of the various `check-*` targets of the build system.
12//!
13//! This file implements the various regression test suites that we execute on
14//! our CI.
15
Alex Crichtona270b802016-10-21 20:18:0916use std::collections::HashSet;
Alex Crichtonbb9062a2016-04-29 21:23:1517use std::env;
Alex Crichton147e2da2016-10-07 06:30:3818use std::fs;
Alex Crichtonede89442016-04-15 01:00:3519use std::path::{PathBuf, Path};
20use std::process::Command;
Alex Crichton73c2d2a2016-04-14 21:27:5121
Alex Crichton126e09e2016-04-14 22:51:0322use build_helper::output;
Alex Crichton126e09e2016-04-14 22:51:0323
Alex Crichton48a07bf2016-07-06 04:58:2024use {Build, Compiler, Mode};
25use util::{self, dylib_path, dylib_path_var};
Alex Crichton39a5d3f2016-06-28 20:31:3026
27const ADB_TEST_DIR: &'static str = "/data/tmp";
Alex Crichtondefd1b32016-03-08 07:15:5528
Alex Crichtonf72bfe62016-05-02 22:16:1529/// Runs the `linkchecker` tool as compiled in `stage` by the `host` compiler.
30///
31/// This tool in `src/tools` will verify the validity of all our links in the
32/// documentation to ensure we don't have a bunch of dead ones.
Alex Crichtondefd1b32016-03-08 07:15:5533pub fn linkcheck(build: &Build, stage: u32, host: &str) {
34 println!("Linkcheck stage{} ({})", stage, host);
35 let compiler = Compiler::new(stage, host);
Alex Crichton4a917e02016-03-12 00:21:0536 build.run(build.tool_cmd(&compiler, "linkchecker")
37 .arg(build.out.join(host).join("doc")));
Alex Crichtondefd1b32016-03-08 07:15:5538}
Brian Anderson3a790ac2016-03-18 20:54:3139
Alex Crichtonf72bfe62016-05-02 22:16:1540/// Runs the `cargotest` tool as compiled in `stage` by the `host` compiler.
41///
42/// This tool in `src/tools` will check out a few Rust projects and run `cargo
43/// test` to ensure that we don't regress the test suites there.
Brian Anderson3a790ac2016-03-18 20:54:3144pub fn cargotest(build: &Build, stage: u32, host: &str) {
45 let ref compiler = Compiler::new(stage, host);
Brian Anderson80199222016-04-06 18:03:4246
47 // Configure PATH to find the right rustc. NB. we have to use PATH
48 // and not RUSTC because the Cargo test suite has tests that will
49 // fail if rustc is not spelled `rustc`.
50 let path = build.sysroot(compiler).join("bin");
51 let old_path = ::std::env::var("PATH").expect("");
52 let sep = if cfg!(windows) { ";" } else {":" };
53 let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
54
Alex Crichton73c2d2a2016-04-14 21:27:5155 // Note that this is a short, cryptic, and not scoped directory name. This
56 // is currently to minimize the length of path on Windows where we otherwise
57 // quickly run into path name limit constraints.
58 let out_dir = build.out.join("ct");
59 t!(fs::create_dir_all(&out_dir));
60
Brian Anderson3a790ac2016-03-18 20:54:3161 build.run(build.tool_cmd(compiler, "cargotest")
Alex Crichton73c2d2a2016-04-14 21:27:5162 .env("PATH", newpath)
63 .arg(&build.cargo)
64 .arg(&out_dir));
Brian Anderson3a790ac2016-03-18 20:54:3165}
Alex Crichton9dd3c542016-03-29 20:14:5266
Alex Crichtonf72bfe62016-05-02 22:16:1567/// Runs the `tidy` tool as compiled in `stage` by the `host` compiler.
68///
69/// This tool in `src/tools` checks up on various bits and pieces of style and
70/// otherwise just implements a few lint-like checks that are specific to the
71/// compiler itself.
Alex Crichton9dd3c542016-03-29 20:14:5272pub fn tidy(build: &Build, stage: u32, host: &str) {
73 println!("tidy check stage{} ({})", stage, host);
74 let compiler = Compiler::new(stage, host);
75 build.run(build.tool_cmd(&compiler, "tidy")
76 .arg(build.src.join("src")));
77}
Alex Crichtonb325baf2016-04-05 18:34:2378
79fn testdir(build: &Build, host: &str) -> PathBuf {
80 build.out.join(host).join("test")
81}
82
Alex Crichtonf72bfe62016-05-02 22:16:1583/// Executes the `compiletest` tool to run a suite of tests.
84///
85/// Compiles all tests with `compiler` for `target` with the specified
86/// compiletest `mode` and `suite` arguments. For example `mode` can be
87/// "run-pass" or `suite` can be something like `debuginfo`.
Alex Crichtonb325baf2016-04-05 18:34:2388pub fn compiletest(build: &Build,
89 compiler: &Compiler,
90 target: &str,
91 mode: &str,
92 suite: &str) {
Alex Crichton39a5d3f2016-06-28 20:31:3093 println!("Check compiletest {} ({} -> {})", suite, compiler.host, target);
Alex Crichtonb325baf2016-04-05 18:34:2394 let mut cmd = build.tool_cmd(compiler, "compiletest");
95
Alex Crichtonf72bfe62016-05-02 22:16:1596 // compiletest currently has... a lot of arguments, so let's just pass all
97 // of them!
98
Alex Crichtonb325baf2016-04-05 18:34:2399 cmd.arg("--compile-lib-path").arg(build.rustc_libdir(compiler));
100 cmd.arg("--run-lib-path").arg(build.sysroot_libdir(compiler, target));
101 cmd.arg("--rustc-path").arg(build.compiler_path(compiler));
102 cmd.arg("--rustdoc-path").arg(build.rustdoc(compiler));
103 cmd.arg("--src-base").arg(build.src.join("src/test").join(suite));
Alex Crichtonb325baf2016-04-05 18:34:23104 cmd.arg("--build-base").arg(testdir(build, compiler.host).join(suite));
105 cmd.arg("--stage-id").arg(format!("stage{}-{}", compiler.stage, target));
106 cmd.arg("--mode").arg(mode);
107 cmd.arg("--target").arg(target);
108 cmd.arg("--host").arg(compiler.host);
109 cmd.arg("--llvm-filecheck").arg(build.llvm_filecheck(&build.config.build));
110
Brian Anderson8401e372016-09-15 19:42:26111 if let Some(nodejs) = build.config.nodejs.as_ref() {
112 cmd.arg("--nodejs").arg(nodejs);
113 }
114
Alex Crichton39a5d3f2016-06-28 20:31:30115 let mut flags = vec!["-Crpath".to_string()];
Alex Crichtonf4e4ec72016-05-13 22:26:41116 if build.config.rust_optimize_tests {
Alex Crichton39a5d3f2016-06-28 20:31:30117 flags.push("-O".to_string());
Alex Crichtonf4e4ec72016-05-13 22:26:41118 }
119 if build.config.rust_debuginfo_tests {
Alex Crichton39a5d3f2016-06-28 20:31:30120 flags.push("-g".to_string());
Alex Crichtonf4e4ec72016-05-13 22:26:41121 }
122
Alex Crichton39a5d3f2016-06-28 20:31:30123 let mut hostflags = build.rustc_flags(&compiler.host);
124 hostflags.extend(flags.clone());
125 cmd.arg("--host-rustcflags").arg(hostflags.join(" "));
Alex Crichtonf4e4ec72016-05-13 22:26:41126
Alex Crichton39a5d3f2016-06-28 20:31:30127 let mut targetflags = build.rustc_flags(&target);
128 targetflags.extend(flags);
129 targetflags.push(format!("-Lnative={}",
130 build.test_helpers_out(target).display()));
131 cmd.arg("--target-rustcflags").arg(targetflags.join(" "));
Alex Crichtoncbe62922016-04-19 16:44:19132
Alex Crichtonb325baf2016-04-05 18:34:23133 // FIXME: CFG_PYTHON should probably be detected more robustly elsewhere
Alex Crichtoncbe62922016-04-19 16:44:19134 let python_default = "python";
135 cmd.arg("--docck-python").arg(python_default);
136
137 if build.config.build.ends_with("apple-darwin") {
138 // Force /usr/bin/python on OSX for LLDB tests because we're loading the
139 // LLDB plugin's compiled module which only works with the system python
140 // (namely not Homebrew-installed python)
141 cmd.arg("--lldb-python").arg("/usr/bin/python");
142 } else {
143 cmd.arg("--lldb-python").arg(python_default);
144 }
Alex Crichtonb325baf2016-04-05 18:34:23145
146 if let Some(ref vers) = build.gdb_version {
147 cmd.arg("--gdb-version").arg(vers);
148 }
149 if let Some(ref vers) = build.lldb_version {
150 cmd.arg("--lldb-version").arg(vers);
151 }
152 if let Some(ref dir) = build.lldb_python_dir {
153 cmd.arg("--lldb-python-dir").arg(dir);
154 }
Alex Crichton96283fc2016-09-01 17:52:44155 let llvm_config = build.llvm_config(target);
156 let llvm_version = output(Command::new(&llvm_config).arg("--version"));
157 cmd.arg("--llvm-version").arg(llvm_version);
Alex Crichtonb325baf2016-04-05 18:34:23158
Alex Crichtona270b802016-10-21 20:18:09159 cmd.args(&build.flags.cmd.test_args());
Alex Crichtonb325baf2016-04-05 18:34:23160
161 if build.config.verbose || build.flags.verbose {
162 cmd.arg("--verbose");
163 }
164
Corey Farwellc8c6d2c2016-10-30 01:58:52165 if build.config.quiet_tests {
166 cmd.arg("--quiet");
167 }
168
Alex Crichtonf72bfe62016-05-02 22:16:15169 // Only pass correct values for these flags for the `run-make` suite as it
170 // requires that a C++ compiler was configured which isn't always the case.
Alex Crichton126e09e2016-04-14 22:51:03171 if suite == "run-make" {
Alex Crichton126e09e2016-04-14 22:51:03172 let llvm_components = output(Command::new(&llvm_config).arg("--components"));
173 let llvm_cxxflags = output(Command::new(&llvm_config).arg("--cxxflags"));
174 cmd.arg("--cc").arg(build.cc(target))
175 .arg("--cxx").arg(build.cxx(target))
176 .arg("--cflags").arg(build.cflags(target).join(" "))
177 .arg("--llvm-components").arg(llvm_components.trim())
178 .arg("--llvm-cxxflags").arg(llvm_cxxflags.trim());
179 } else {
180 cmd.arg("--cc").arg("")
181 .arg("--cxx").arg("")
182 .arg("--cflags").arg("")
183 .arg("--llvm-components").arg("")
184 .arg("--llvm-cxxflags").arg("");
185 }
186
187 // Running a C compiler on MSVC requires a few env vars to be set, to be
188 // sure to set them here.
189 if target.contains("msvc") {
190 for &(ref k, ref v) in build.cc[target].0.env() {
191 if k != "PATH" {
192 cmd.env(k, v);
193 }
194 }
195 }
Brian Andersond3c59052016-10-18 22:42:01196 build.add_bootstrap_key(&mut cmd);
Alex Crichton126e09e2016-04-14 22:51:03197
Alex Crichton39a5d3f2016-06-28 20:31:30198 cmd.arg("--adb-path").arg("adb");
199 cmd.arg("--adb-test-dir").arg(ADB_TEST_DIR);
200 if target.contains("android") {
201 // Assume that cc for this target comes from the android sysroot
202 cmd.arg("--android-cross-path")
203 .arg(build.cc(target).parent().unwrap().parent().unwrap());
204 } else {
205 cmd.arg("--android-cross-path").arg("");
206 }
207
Alex Crichtonb325baf2016-04-05 18:34:23208 build.run(&mut cmd);
209}
Alex Crichtonede89442016-04-15 01:00:35210
Alex Crichtonf72bfe62016-05-02 22:16:15211/// Run `rustdoc --test` for all documentation in `src/doc`.
212///
213/// This will run all tests in our markdown documentation (e.g. the book)
214/// located in `src/doc`. The `rustdoc` that's run is the one that sits next to
215/// `compiler`.
Alex Crichtonede89442016-04-15 01:00:35216pub fn docs(build: &Build, compiler: &Compiler) {
Alex Crichtonf72bfe62016-05-02 22:16:15217 // Do a breadth-first traversal of the `src/doc` directory and just run
218 // tests for all files that end in `*.md`
Alex Crichtonede89442016-04-15 01:00:35219 let mut stack = vec![build.src.join("src/doc")];
220
221 while let Some(p) = stack.pop() {
222 if p.is_dir() {
223 stack.extend(t!(p.read_dir()).map(|p| t!(p).path()));
224 continue
225 }
226
227 if p.extension().and_then(|s| s.to_str()) != Some("md") {
228 continue
229 }
230
231 println!("doc tests for: {}", p.display());
232 markdown_test(build, compiler, &p);
233 }
234}
235
Alex Crichtonf72bfe62016-05-02 22:16:15236/// Run the error index generator tool to execute the tests located in the error
237/// index.
238///
239/// The `error_index_generator` tool lives in `src/tools` and is used to
240/// generate a markdown file from the error indexes of the code base which is
241/// then passed to `rustdoc --test`.
Alex Crichtonede89442016-04-15 01:00:35242pub fn error_index(build: &Build, compiler: &Compiler) {
243 println!("Testing error-index stage{}", compiler.stage);
244
245 let output = testdir(build, compiler.host).join("error-index.md");
246 build.run(build.tool_cmd(compiler, "error_index_generator")
247 .arg("markdown")
248 .arg(&output)
249 .env("CFG_BUILD", &build.config.build));
250
251 markdown_test(build, compiler, &output);
252}
253
254fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) {
255 let mut cmd = Command::new(build.rustdoc(compiler));
256 build.add_rustc_lib_path(compiler, &mut cmd);
257 cmd.arg("--test");
258 cmd.arg(markdown);
Corey Farwellc8c6d2c2016-10-30 01:58:52259
Alex Crichtona270b802016-10-21 20:18:09260 let mut test_args = build.flags.cmd.test_args().join(" ");
Corey Farwellc8c6d2c2016-10-30 01:58:52261 if build.config.quiet_tests {
262 test_args.push_str(" --quiet");
263 }
264 cmd.arg("--test-args").arg(test_args);
265
Alex Crichtonede89442016-04-15 01:00:35266 build.run(&mut cmd);
267}
Alex Crichtonbb9062a2016-04-29 21:23:15268
269/// Run all unit tests plus documentation tests for an entire crate DAG defined
270/// by a `Cargo.toml`
271///
272/// This is what runs tests for crates like the standard library, compiler, etc.
273/// It essentially is the driver for running `cargo test`.
274///
275/// Currently this runs all tests for a DAG by passing a bunch of `-p foo`
Alex Crichton147e2da2016-10-07 06:30:38276/// arguments, and those arguments are discovered from `cargo metadata`.
Alex Crichtonbb9062a2016-04-29 21:23:15277pub fn krate(build: &Build,
278 compiler: &Compiler,
279 target: &str,
Alex Crichtona270b802016-10-21 20:18:09280 mode: Mode,
281 krate: Option<&str>) {
Alex Crichton147e2da2016-10-07 06:30:38282 let (name, path, features, root) = match mode {
Ahmed Charles9ca382f2016-09-02 08:55:29283 Mode::Libstd => {
Alex Crichton147e2da2016-10-07 06:30:38284 ("libstd", "src/rustc/std_shim", build.std_features(), "std_shim")
Ahmed Charles9ca382f2016-09-02 08:55:29285 }
286 Mode::Libtest => {
Alex Crichton147e2da2016-10-07 06:30:38287 ("libtest", "src/rustc/test_shim", String::new(), "test_shim")
Ahmed Charles9ca382f2016-09-02 08:55:29288 }
289 Mode::Librustc => {
Alex Crichton147e2da2016-10-07 06:30:38290 ("librustc", "src/rustc", build.rustc_features(), "rustc-main")
Ahmed Charles9ca382f2016-09-02 08:55:29291 }
Alex Crichtonbb9062a2016-04-29 21:23:15292 _ => panic!("can only test libraries"),
293 };
294 println!("Testing {} stage{} ({} -> {})", name, compiler.stage,
295 compiler.host, target);
296
Alex Crichtonbb9062a2016-04-29 21:23:15297 // Build up the base `cargo test` command.
Alex Crichton147e2da2016-10-07 06:30:38298 //
299 // Pass in some standard flags then iterate over the graph we've discovered
300 // in `cargo metadata` with the maps above and figure out what `-p`
301 // arguments need to get passed.
Alex Crichtonbb9062a2016-04-29 21:23:15302 let mut cargo = build.cargo(compiler, mode, target, "test");
303 cargo.arg("--manifest-path")
304 .arg(build.src.join(path).join("Cargo.toml"))
305 .arg("--features").arg(features);
306
Alex Crichtona270b802016-10-21 20:18:09307 match krate {
308 Some(krate) => {
309 cargo.arg("-p").arg(krate);
Alex Crichtonbb9062a2016-04-29 21:23:15310 }
Alex Crichtona270b802016-10-21 20:18:09311 None => {
312 let mut visited = HashSet::new();
313 let mut next = vec![root];
314 while let Some(name) = next.pop() {
315 // Right now jemalloc is our only target-specific crate in the sense
316 // that it's not present on all platforms. Custom skip it here for now,
317 // but if we add more this probably wants to get more generalized.
318 if !name.contains("jemalloc") {
319 cargo.arg("-p").arg(name);
320 }
321 for dep in build.crates[name].deps.iter() {
322 if visited.insert(dep) {
323 next.push(dep);
324 }
325 }
Alex Crichtonbb9062a2016-04-29 21:23:15326 }
327 }
Alex Crichtonbb9062a2016-04-29 21:23:15328 }
329
330 // The tests are going to run with the *target* libraries, so we need to
331 // ensure that those libraries show up in the LD_LIBRARY_PATH equivalent.
332 //
333 // Note that to run the compiler we need to run with the *host* libraries,
334 // but our wrapper scripts arrange for that to be the case anyway.
335 let mut dylib_path = dylib_path();
336 dylib_path.insert(0, build.sysroot_libdir(compiler, target));
337 cargo.env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());
Alex Crichtonbb9062a2016-04-29 21:23:15338
Corey Farwellc8c6d2c2016-10-30 01:58:52339 if build.config.quiet_tests {
340 cargo.arg("--");
341 cargo.arg("--quiet");
342 }
343
Alex Crichton39a5d3f2016-06-28 20:31:30344 if target.contains("android") {
345 build.run(cargo.arg("--no-run"));
346 krate_android(build, compiler, target, mode);
Brian Andersonb8b50f02016-09-06 00:41:50347 } else if target.contains("emscripten") {
Ross Schulmanad9184c2016-09-05 23:56:48348 build.run(cargo.arg("--no-run"));
Brian Andersonb8b50f02016-09-06 00:41:50349 krate_emscripten(build, compiler, target, mode);
Alex Crichton39a5d3f2016-06-28 20:31:30350 } else {
Alex Crichtona270b802016-10-21 20:18:09351 cargo.args(&build.flags.cmd.test_args());
Alex Crichton39a5d3f2016-06-28 20:31:30352 build.run(&mut cargo);
353 }
354}
355
356fn krate_android(build: &Build,
357 compiler: &Compiler,
358 target: &str,
359 mode: Mode) {
360 let mut tests = Vec::new();
361 let out_dir = build.cargo_out(compiler, mode, target);
362 find_tests(&out_dir, target, &mut tests);
363 find_tests(&out_dir.join("deps"), target, &mut tests);
364
365 for test in tests {
366 build.run(Command::new("adb").arg("push").arg(&test).arg(ADB_TEST_DIR));
367
368 let test_file_name = test.file_name().unwrap().to_string_lossy();
369 let log = format!("{}/check-stage{}-T-{}-H-{}-{}.log",
370 ADB_TEST_DIR,
371 compiler.stage,
372 target,
373 compiler.host,
374 test_file_name);
375 let program = format!("(cd {dir}; \
376 LD_LIBRARY_PATH=./{target} ./{test} \
377 --logfile {log} \
378 {args})",
379 dir = ADB_TEST_DIR,
380 target = target,
381 test = test_file_name,
382 log = log,
Alex Crichtona270b802016-10-21 20:18:09383 args = build.flags.cmd.test_args().join(" "));
Alex Crichton39a5d3f2016-06-28 20:31:30384
385 let output = output(Command::new("adb").arg("shell").arg(&program));
386 println!("{}", output);
387 build.run(Command::new("adb")
388 .arg("pull")
389 .arg(&log)
390 .arg(build.out.join("tmp")));
391 build.run(Command::new("adb").arg("shell").arg("rm").arg(&log));
392 if !output.contains("result: ok") {
393 panic!("some tests failed");
394 }
395 }
396}
397
Brian Andersonb8b50f02016-09-06 00:41:50398fn krate_emscripten(build: &Build,
399 compiler: &Compiler,
400 target: &str,
401 mode: Mode) {
Ross Schulmanad9184c2016-09-05 23:56:48402 let mut tests = Vec::new();
403 let out_dir = build.cargo_out(compiler, mode, target);
404 find_tests(&out_dir, target, &mut tests);
405 find_tests(&out_dir.join("deps"), target, &mut tests);
406
407 for test in tests {
408 let test_file_name = test.to_string_lossy().into_owned();
Brian Andersonfcd32792016-09-06 20:36:14409 println!("running {}", test_file_name);
Brian Anderson8401e372016-09-15 19:42:26410 let nodejs = build.config.nodejs.as_ref().expect("nodejs not configured");
Brian Andersonbadfd622016-09-27 19:56:50411 let status = Command::new(nodejs)
Brian Andersonfcd32792016-09-06 20:36:14412 .arg(&test_file_name)
413 .stderr(::std::process::Stdio::inherit())
Brian Andersonbadfd622016-09-27 19:56:50414 .status();
415 match status {
416 Ok(status) => {
417 if !status.success() {
418 panic!("some tests failed");
419 }
420 }
Brian Andersonfcd32792016-09-06 20:36:14421 Err(e) => panic!(format!("failed to execute command: {}", e)),
422 };
Ross Schulmanad9184c2016-09-05 23:56:48423 }
424 }
425
426
Alex Crichton39a5d3f2016-06-28 20:31:30427fn find_tests(dir: &Path,
428 target: &str,
429 dst: &mut Vec<PathBuf>) {
430 for e in t!(dir.read_dir()).map(|e| t!(e)) {
431 let file_type = t!(e.file_type());
432 if !file_type.is_file() {
433 continue
434 }
435 let filename = e.file_name().into_string().unwrap();
436 if (target.contains("windows") && filename.ends_with(".exe")) ||
Ross Schulmanad9184c2016-09-05 23:56:48437 (!target.contains("windows") && !filename.contains(".")) ||
Brian Andersonfcd32792016-09-06 20:36:14438 (target.contains("emscripten") && filename.contains(".js")){
Alex Crichton39a5d3f2016-06-28 20:31:30439 dst.push(e.path());
440 }
441 }
442}
443
444pub fn android_copy_libs(build: &Build,
445 compiler: &Compiler,
446 target: &str) {
447 println!("Android copy libs to emulator ({})", target);
448 build.run(Command::new("adb").arg("remount"));
449 build.run(Command::new("adb").args(&["shell", "rm", "-r", ADB_TEST_DIR]));
450 build.run(Command::new("adb").args(&["shell", "mkdir", ADB_TEST_DIR]));
451 build.run(Command::new("adb")
452 .arg("push")
453 .arg(build.src.join("src/etc/adb_run_wrapper.sh"))
454 .arg(ADB_TEST_DIR));
455
456 let target_dir = format!("{}/{}", ADB_TEST_DIR, target);
457 build.run(Command::new("adb").args(&["shell", "mkdir", &target_dir[..]]));
458
459 for f in t!(build.sysroot_libdir(compiler, target).read_dir()) {
460 let f = t!(f);
461 let name = f.file_name().into_string().unwrap();
462 if util::is_dylib(&name) {
463 build.run(Command::new("adb")
464 .arg("push")
465 .arg(f.path())
466 .arg(&target_dir));
467 }
468 }
Alex Crichtonbb9062a2016-04-29 21:23:15469}