]> git.lizzy.rs Git - rust.git/commitdiff
Android: Pass the environment when running tests
authorSeo Sanghyeon <sanxiyn@gmail.com>
Wed, 28 Aug 2013 12:44:55 +0000 (21:44 +0900)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Wed, 28 Aug 2013 12:44:55 +0000 (21:44 +0900)
src/compiletest/runtest.rs

index 555ffde029f2edd64ddd783ae999bfa00fa35a6d..5467995a6b52020187b72a96778bb020d9423dac 100644 (file)
@@ -551,7 +551,7 @@ fn exec_compiled_test(config: &config, props: &TestProps,
 
         ~"arm-linux-androideabi" => {
             if (config.adb_device_status) {
-                _arm_exec_compiled_test(config, props, testfile)
+                _arm_exec_compiled_test(config, props, testfile, env)
             } else {
                 _dummy_exec_compiled_test(config, props, testfile)
             }
@@ -777,7 +777,7 @@ fn fatal_ProcRes(err: ~str, ProcRes: &ProcRes) -> ! {
 }
 
 fn _arm_exec_compiled_test(config: &config, props: &TestProps,
-                      testfile: &Path) -> ProcRes {
+                      testfile: &Path, env: ~[(~str, ~str)]) -> ProcRes {
 
     let args = make_run_args(config, props, testfile);
     let cmdline = make_cmdline("", args.prog, args.args);
@@ -803,6 +803,9 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
 
     // run test via adb_run_wrapper
     runargs.push(~"shell");
+    for (key, val) in env.move_iter() {
+        runargs.push(fmt!("%s=%s", key, val));
+    }
     runargs.push(fmt!("%s/adb_run_wrapper.sh", config.adb_test_dir));
     runargs.push(fmt!("%s", config.adb_test_dir));
     runargs.push(fmt!("%s", prog_short));