diff --git a/mk/tests.mk b/mk/tests.mk index 21754a9f51d..310dec8de79 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -502,12 +502,13 @@ ifeq ($(CFG_ADB_DEVICE),true) CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \ --compile-lib-path $$(HLIB$(1)_H_$(3)) \ --run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \ - --rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \ - --aux-base $$(S)src/test/auxiliary/ \ + --rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \ + --aux-base $$(S)src/test/auxiliary/ \ --stage-id stage$(1)-$(2) \ --host $(CFG_BUILD_TRIPLE) \ --target $(2) \ --adb-path=$(CFG_ADB_PATH) \ + --adb-test-dir=$(CFG_ADB_TEST_DIR) \ --rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \ $$(CTEST_TESTARGS) @@ -516,7 +517,7 @@ else CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \ --compile-lib-path $$(HLIB$(1)_H_$(3)) \ --run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \ - --rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \ + --rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \ --aux-base $$(S)src/test/auxiliary/ \ --stage-id stage$(1)-$(2) \ --host $(CFG_BUILD_TRIPLE) \ diff --git a/src/compiletest/common.rs b/src/compiletest/common.rs index 73322fe1bde..87a7dae5a7f 100644 --- a/src/compiletest/common.rs +++ b/src/compiletest/common.rs @@ -70,9 +70,12 @@ pub struct config { // Target System to be executed target: ~str, - // Extra parameter to run arm-linux-androideabi + // Extra parameter to run adb on arm-linux-androideabi adb_path: ~str, + // Extra parameter to run test sute on arm-linux-androideabi + adb_test_dir: ~str, + // check if can be run or not flag_runnable: bool, diff --git a/src/compiletest/compiletest.rc b/src/compiletest/compiletest.rc index 70e09fc7bab..5575c01a906 100644 --- a/src/compiletest/compiletest.rc +++ b/src/compiletest/compiletest.rc @@ -63,7 +63,8 @@ pub fn parse_config(args: ~[~str]) -> config { getopts::optflag(~"newrt"), getopts::optopt(~"host"), getopts::optopt(~"target"), - getopts::optopt(~"adb-path") + getopts::optopt(~"adb-path"), + getopts::optopt(~"adb-test-dir") ]; assert!(!args.is_empty()); @@ -100,6 +101,7 @@ pub fn parse_config(args: ~[~str]) -> config { host: opt_str(getopts::opt_maybe_str(matches, ~"host")), target: opt_str(getopts::opt_maybe_str(matches, ~"target")), adb_path: opt_str(getopts::opt_maybe_str(matches, ~"adb-path")), + adb_test_dir: opt_str(getopts::opt_maybe_str(matches, ~"adb-test-dir")), flag_runnable: if (getopts::opt_maybe_str(matches, ~"host") == getopts::opt_maybe_str(matches, ~"target")) { true } @@ -136,6 +138,7 @@ pub fn log_config(config: config) { logv(c, fmt!("host: %s", config.host)); logv(c, fmt!("target: %s", config.target)); logv(c, fmt!("adb_path: %s", config.adb_path)); + logv(c, fmt!("adb_test_dir: %s", config.adb_test_dir)); logv(c, fmt!("flag_runnable: %b", config.flag_runnable)); logv(c, fmt!("verbose: %b", config.verbose)); logv(c, fmt!("\n")); diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index ad128f4529c..142460fe0dc 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -512,7 +512,7 @@ fn exec_compiled_test(config: config, props: TestProps, // copy to target let copy_result = procsrv::run(~"", config.adb_path, - ~[~"push", args.prog, ~"/system/tmp"], + ~[~"push", args.prog, config.adb_test_dir], ~[(~"",~"")], Some(~"")); if config.verbose { @@ -534,16 +534,13 @@ fn exec_compiled_test(config: config, props: TestProps, let mut newcmd_out = ~""; let mut newcmd_err = ~""; - newcmd_out.push_str(~"LD_LIBRARY_PATH=/system/tmp; "); - newcmd_err.push_str(~"LD_LIBRARY_PATH=/system/tmp; "); - newcmd_out.push_str(~"export LD_LIBRARY_PATH; "); - newcmd_err.push_str(~"export LD_LIBRARY_PATH; "); - newcmd_out.push_str(~"cd /system/tmp; "); - newcmd_err.push_str(~"cd /system/tmp; "); - newcmd_out.push_str("./"); - newcmd_err.push_str("./"); - newcmd_out.push_str(prog_short); - newcmd_err.push_str(prog_short); + newcmd_out.push_str(fmt!( + "LD_LIBRARY_PATH=%s; export LD_LIBRARY_PATH; cd %s; ./%s", + config.adb_test_dir, config.adb_test_dir, prog_short)); + + newcmd_err.push_str(fmt!( + "LD_LIBRARY_PATH=%s; export LD_LIBRARY_PATH; cd %s; ./%s", + config.adb_test_dir, config.adb_test_dir, prog_short)); for vec::each(subargs) |tv| { newcmd_out.push_str(" "); @@ -617,7 +614,7 @@ fn compose_and_run_compiler( if (file.filetype() == Some(~".so")) { let copy_result = procsrv::run(~"", config.adb_path, - ~[~"push", file.to_str(), ~"/system/tmp"], + ~[~"push", file.to_str(), config.adb_test_dir], ~[(~"",~"")], Some(~"")); if config.verbose {