diff options
| author | Young-il Choi <duddlf.choi@samsung.com> | 2013-05-02 13:16:01 +0900 |
|---|---|---|
| committer | Young-il Choi <duddlf.choi@samsung.com> | 2013-05-02 13:16:01 +0900 |
| commit | 6f6dd86248d5c3ece0e668537e78a71198f36ddd (patch) | |
| tree | bab70c49a2d5f4e81901d82dac1d7b399f883e23 /src/compiletest | |
| parent | 3afd708e2acd767f1af90de52c139c1b6b877311 (diff) | |
| download | rust-6f6dd86248d5c3ece0e668537e78a71198f36ddd.tar.gz rust-6f6dd86248d5c3ece0e668537e78a71198f36ddd.zip | |
compiletest: configurable test dir for ARM
Diffstat (limited to 'src/compiletest')
| -rw-r--r-- | src/compiletest/common.rs | 5 | ||||
| -rw-r--r-- | src/compiletest/compiletest.rc | 5 | ||||
| -rw-r--r-- | src/compiletest/runtest.rs | 21 |
3 files changed, 17 insertions, 14 deletions
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 { |
