Skip to content

Commit 9e189c6

Browse files
committed
---
yaml --- r: 73639 b: refs/heads/dist-snap c: fe1dc32 h: refs/heads/master i: 73637: b2b4c4a 73635: 7212674 73631: bba81cc v: v3
1 parent 7b6c6ea commit 9e189c6

File tree

2 files changed

+94
-1
lines changed

2 files changed

+94
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: 0ea8274fcaf1585b597f80a3c9d2bbef83549932
10+
refs/heads/dist-snap: fe1dc3280f63fe4cec441837ae20020cbe26dc61
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/compiletest/runtest.rs

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,99 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
753753
copy_result.out, copy_result.err));
754754
}
755755

756+
logv(config, fmt!("executing (%s) %s", config.target, cmdline));
757+
758+
759+
let mut runargs = ~[];
760+
let mut exitcode : int = 1;
761+
let mut maxtry = 10;
762+
763+
// sometimes code generates exit code 1 which is "1 : General unknown error"
764+
// in this case, force to retry
765+
// while exitcode == 1 && maxtry > 0 {
766+
// since adb shell doesnot forward internal result (exit code) and
767+
// distingush stderr and stdout, adb_run_wrapper is used
768+
769+
runargs.push(~"shell");
770+
runargs.push(fmt!("%s/adb_run_wrapper.sh", config.adb_test_dir));
771+
runargs.push(fmt!("%s", prog_short));
772+
773+
for args.args.each |tv| {
774+
runargs.push(tv.to_owned());
775+
}
776+
777+
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")], Some(~""));
778+
779+
// get exitcode of result
780+
runargs = ~[];
781+
782+
runargs.push(~"shell");
783+
runargs.push(~"cat");
784+
runargs.push(fmt!("%s/%s.exitcode", config.adb_test_dir, prog_short));
785+
786+
let procsrv::Result{ out: exitcode_out, err: exitcode_err, status: exitcode_status } =
787+
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")],
788+
Some(~""));
789+
790+
exitcode = 0;
791+
for str::each_char(exitcode_out) |c| {
792+
if !char::is_digit(c) { break; }
793+
exitcode = exitcode * 10 + match c {
794+
'0' .. '9' => c as int - ('0' as int),
795+
_ => 0,
796+
}
797+
}
798+
maxtry = maxtry - 1;
799+
// unsafe { libc::sleep(1); }
800+
// }
801+
802+
// get stdout of result
803+
runargs = ~[];
804+
runargs.push(~"shell");
805+
runargs.push(~"cat");
806+
runargs.push(fmt!("%s/%s.stdout", config.adb_test_dir, prog_short));
807+
808+
let procsrv::Result{ out: stdout_out, err: stdout_err, status: stdout_status } =
809+
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")],
810+
Some(~""));
811+
812+
// get stderr of result
813+
runargs = ~[];
814+
runargs.push(~"shell");
815+
runargs.push(~"cat");
816+
runargs.push(fmt!("%s/%s.stderr", config.adb_test_dir, prog_short));
817+
818+
let procsrv::Result{ out: stderr_out, err: stderr_err, status: stderr_status } =
819+
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")],
820+
Some(~""));
821+
822+
dump_output(config, testfile, stdout_out, stderr_out);
823+
824+
ProcRes {status: exitcode, stdout: stdout_out, stderr: stderr_out, cmdline: cmdline }
825+
}
826+
827+
fn _arm_exec_compiled_test2(config: &config, props: &TestProps,
828+
testfile: &Path) -> ProcRes {
829+
830+
let args = make_run_args(config, props, testfile);
831+
let cmdline = make_cmdline("", args.prog, args.args);
832+
833+
// get bare program string
834+
let mut tvec = ~[];
835+
for str::each_split_char(args.prog, '/') |ts| { tvec.push(ts.to_owned()) }
836+
let prog_short = tvec.pop();
837+
838+
// copy to target
839+
let copy_result = procsrv::run("", config.adb_path,
840+
[~"push", copy args.prog, copy config.adb_test_dir],
841+
~[(~"",~"")], Some(~""));
842+
843+
if config.verbose {
844+
io::stdout().write_str(fmt!("push (%s) %s %s %s",
845+
config.target, args.prog,
846+
copy_result.out, copy_result.err));
847+
}
848+
756849
// execute program
757850
logv(config, fmt!("executing (%s) %s", config.target, cmdline));
758851

0 commit comments

Comments
 (0)