Skip to content

Commit 1cc09dd

Browse files
committed
---
yaml --- r: 148850 b: refs/heads/try2 c: 27a9bf7 h: refs/heads/master v: v3
1 parent 1c03f2f commit 1cc09dd

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 5e8ba7252a162fc6a3c5186904947f5969d732af
8+
refs/heads/try2: 27a9bf773c525e17dce80320af56b7c7814f9829
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/compiletest.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,13 @@ pub fn run_tests(config: &config) {
234234
// For context, see #8904
235235
io::test::raise_fd_limit();
236236
let res = test::run_tests_console(&opts, tests);
237-
if !res { fail!("Some tests failed"); }
237+
match res {
238+
Ok(true) => {}
239+
Ok(false) => fail!("Some tests failed"),
240+
Err(e) => {
241+
println!("I/O failure during tests: {}", e);
242+
}
243+
}
238244
}
239245

240246
pub fn test_opts(config: &config) -> test::TestOpts {
@@ -255,7 +261,7 @@ pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
255261
debug!("making tests from {}",
256262
config.src_base.display());
257263
let mut tests = ~[];
258-
let dirs = fs::readdir(&config.src_base);
264+
let dirs = fs::readdir(&config.src_base).unwrap();
259265
for file in dirs.iter() {
260266
let file = file.clone();
261267
debug!("inspecting file {}", file.display());

branches/try2/src/compiletest/procsrv.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ pub fn run(lib_path: &str,
5858
});
5959

6060
match opt_process {
61-
Some(ref mut process) => {
61+
Ok(ref mut process) => {
6262
for input in input.iter() {
63-
process.input().write(input.as_bytes());
63+
process.input().write(input.as_bytes()).unwrap();
6464
}
6565
let run::ProcessOutput { status, output, error } = process.finish_with_output();
6666

@@ -70,7 +70,7 @@ pub fn run(lib_path: &str,
7070
err: str::from_utf8_owned(error).unwrap()
7171
})
7272
},
73-
None => None
73+
Err(..) => None
7474
}
7575
}
7676

@@ -90,13 +90,13 @@ pub fn run_background(lib_path: &str,
9090
});
9191

9292
match opt_process {
93-
Some(mut process) => {
93+
Ok(mut process) => {
9494
for input in input.iter() {
95-
process.input().write(input.as_bytes());
95+
process.input().write(input.as_bytes()).unwrap();
9696
}
9797

9898
Some(process)
9999
},
100-
None => None
100+
Err(..) => None
101101
}
102102
}

branches/try2/src/compiletest/runtest.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
153153
let rounds =
154154
match props.pp_exact { Some(_) => 1, None => 2 };
155155

156-
let src = File::open(testfile).read_to_end();
156+
let src = File::open(testfile).read_to_end().unwrap();
157157
let src = str::from_utf8_owned(src).unwrap();
158158
let mut srcs = ~[src];
159159

@@ -175,7 +175,7 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
175175
let mut expected = match props.pp_exact {
176176
Some(ref file) => {
177177
let filepath = testfile.dir_path().join(file);
178-
let s = File::open(&filepath).read_to_end();
178+
let s = File::open(&filepath).read_to_end().unwrap();
179179
str::from_utf8_owned(s).unwrap()
180180
}
181181
None => { srcs[srcs.len() - 2u].clone() }
@@ -318,8 +318,10 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
318318
//waiting 1 second for gdbserver start
319319
timer::sleep(1000);
320320
let result = task::try(proc() {
321-
tcp::TcpStream::connect(
322-
SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: 5039 });
321+
tcp::TcpStream::connect(SocketAddr {
322+
ip: Ipv4Addr(127, 0, 0, 1),
323+
port: 5039,
324+
}).unwrap();
323325
});
324326
if result.is_err() {
325327
continue;
@@ -361,7 +363,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
361363
stdout: out,
362364
stderr: err,
363365
cmdline: cmdline};
364-
process.force_destroy();
366+
process.force_destroy().unwrap();
365367
}
366368

367369
_=> {
@@ -727,7 +729,7 @@ fn compose_and_run_compiler(
727729

728730
fn ensure_dir(path: &Path) {
729731
if path.is_dir() { return; }
730-
fs::mkdir(path, io::UserRWX);
732+
fs::mkdir(path, io::UserRWX).unwrap();
731733
}
732734

733735
fn compose_and_run(config: &config, testfile: &Path,
@@ -852,7 +854,7 @@ fn dump_output(config: &config, testfile: &Path, out: &str, err: &str) {
852854
fn dump_output_file(config: &config, testfile: &Path,
853855
out: &str, extension: &str) {
854856
let outfile = make_out_name(config, testfile, extension);
855-
File::create(&outfile).write(out.as_bytes());
857+
File::create(&outfile).write(out.as_bytes()).unwrap();
856858
}
857859

858860
fn make_out_name(config: &config, testfile: &Path, extension: &str) -> Path {
@@ -1003,7 +1005,7 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
10031005
fn _arm_push_aux_shared_library(config: &config, testfile: &Path) {
10041006
let tdir = aux_output_dir_name(config, testfile);
10051007

1006-
let dirs = fs::readdir(&tdir);
1008+
let dirs = fs::readdir(&tdir).unwrap();
10071009
for file in dirs.iter() {
10081010
if file.extension_str() == Some("so") {
10091011
// FIXME (#9639): This needs to handle non-utf8 paths
@@ -1099,7 +1101,7 @@ fn disassemble_extract(config: &config, _props: &TestProps,
10991101

11001102

11011103
fn count_extracted_lines(p: &Path) -> uint {
1102-
let x = File::open(&p.with_extension("ll")).read_to_end();
1104+
let x = File::open(&p.with_extension("ll")).read_to_end().unwrap();
11031105
let x = str::from_utf8_owned(x).unwrap();
11041106
x.lines().len()
11051107
}

0 commit comments

Comments
 (0)