Skip to content

Pass the environment when running tests on the remote device #8839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/compiletest/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ pub struct config {
// Run tests using the JIT
jit: bool,

// Run tests using the new runtime
newrt: bool,

// Target system to be tested
target: ~str,

Expand Down
3 changes: 0 additions & 3 deletions src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ pub fn parse_config(args: ~[~str]) -> config {
optopt("", "ratchet-noise-percent",
"percent change in metrics to consider noise", "N"),
optflag("", "jit", "run tests under the JIT"),
optflag("", "newrt", "run tests on the new runtime / scheduler"),
optopt("", "target", "the target to build for", "TARGET"),
optopt("", "adb-path", "path to the android debugger", "PATH"),
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
Expand Down Expand Up @@ -135,7 +134,6 @@ pub fn parse_config(args: ~[~str]) -> config {
runtool: getopts::opt_maybe_str(matches, "runtool"),
rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
jit: getopts::opt_present(matches, "jit"),
newrt: getopts::opt_present(matches, "newrt"),
target: opt_str2(getopts::opt_maybe_str(matches, "target")).to_str(),
adb_path: opt_str2(getopts::opt_maybe_str(matches, "adb-path")).to_str(),
adb_test_dir:
Expand Down Expand Up @@ -169,7 +167,6 @@ pub fn log_config(config: &config) {
logv(c, fmt!("runtool: %s", opt_str(&config.runtool)));
logv(c, fmt!("rustcflags: %s", opt_str(&config.rustcflags)));
logv(c, fmt!("jit: %b", config.jit));
logv(c, fmt!("newrt: %b", config.newrt));
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));
Expand Down
9 changes: 5 additions & 4 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,15 +545,13 @@ fn compile_test_(config: &config, props: &TestProps,
fn exec_compiled_test(config: &config, props: &TestProps,
testfile: &Path) -> ProcRes {

// If testing the new runtime then set the RUST_NEWRT env var
let env = props.exec_env.clone();
let env = if config.newrt { env + &[(~"RUST_NEWRT", ~"1")] } else { env };

match config.target {

~"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)
}
Expand Down Expand Up @@ -779,7 +777,7 @@ stderr:\n\
}

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);
Expand All @@ -805,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));
Expand Down