Skip to content

Commit b3ec6f4

Browse files
committed
---
yaml --- r: 146165 b: refs/heads/try2 c: 61ed2cf h: refs/heads/master i: 146163: a77fe99 v: v3
1 parent e3427f5 commit b3ec6f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+917
-2029
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: 4eb53360541baf3e6df36dc0f0766bc7c1c9f8be
8+
refs/heads/try2: 61ed2cfb5516f76487509766b1054275f1340f70
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/runtest.rs

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ use util;
2121
use util::logv;
2222

2323
use std::cell::Cell;
24-
use std::io;
24+
use std::rt::io;
25+
use std::rt::io::Writer;
26+
use std::rt::io::extensions::ReaderUtil;
27+
use std::rt::io::file::FileInfo;
2528
use std::os;
2629
use std::str;
2730
use std::task::{spawn_sched, SingleThreaded};
@@ -60,7 +63,7 @@ pub fn run(config: config, testfile: ~str) {
6063
pub fn run_metrics(config: config, testfile: ~str, mm: &mut MetricMap) {
6164
if config.verbose {
6265
// We're going to be dumping a lot of info. Start on a new line.
63-
io::stdout().write_str("\n\n");
66+
print!("\n\n");
6467
}
6568
let testfile = Path::new(testfile);
6669
debug!("running {}", testfile.display());
@@ -170,7 +173,9 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
170173
let rounds =
171174
match props.pp_exact { Some(_) => 1, None => 2 };
172175

173-
let mut srcs = ~[io::read_whole_file_str(testfile).unwrap()];
176+
let src = testfile.open_reader(io::Open).read_to_end();
177+
let src = str::from_utf8_owned(src);
178+
let mut srcs = ~[src];
174179

175180
let mut round = 0;
176181
while round < rounds {
@@ -190,7 +195,8 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
190195
let mut expected = match props.pp_exact {
191196
Some(ref file) => {
192197
let filepath = testfile.dir_path().join(file);
193-
io::read_whole_file_str(&filepath).unwrap()
198+
let s = filepath.open_reader(io::Open).read_to_end();
199+
str::from_utf8_owned(s)
194200
}
195201
None => { srcs[srcs.len() - 2u].clone() }
196202
};
@@ -228,8 +234,7 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
228234
fn compare_source(expected: &str, actual: &str) {
229235
if expected != actual {
230236
error(~"pretty-printed source does not match expected source");
231-
let msg =
232-
format!("\n\
237+
println!("\n\
233238
expected:\n\
234239
------------------------------------------\n\
235240
{}\n\
@@ -240,7 +245,6 @@ actual:\n\
240245
------------------------------------------\n\
241246
\n",
242247
expected, actual);
243-
io::stdout().write_str(msg);
244248
fail!();
245249
}
246250
}
@@ -741,9 +745,7 @@ fn dump_output(config: &config, testfile: &Path, out: &str, err: &str) {
741745
fn dump_output_file(config: &config, testfile: &Path,
742746
out: &str, extension: &str) {
743747
let outfile = make_out_name(config, testfile, extension);
744-
let writer =
745-
io::file_writer(&outfile, [io::Create, io::Truncate]).unwrap();
746-
writer.write_str(out);
748+
outfile.open_writer(io::CreateOrTruncate).write(out.as_bytes());
747749
}
748750

749751
fn make_out_name(config: &config, testfile: &Path, extension: &str) -> Path {
@@ -771,24 +773,20 @@ fn output_base_name(config: &config, testfile: &Path) -> Path {
771773

772774
fn maybe_dump_to_stdout(config: &config, out: &str, err: &str) {
773775
if config.verbose {
774-
let sep1 = format!("------{}------------------------------", "stdout");
775-
let sep2 = format!("------{}------------------------------", "stderr");
776-
let sep3 = ~"------------------------------------------";
777-
io::stdout().write_line(sep1);
778-
io::stdout().write_line(out);
779-
io::stdout().write_line(sep2);
780-
io::stdout().write_line(err);
781-
io::stdout().write_line(sep3);
776+
println!("------{}------------------------------", "stdout");
777+
println!("{}", out);
778+
println!("------{}------------------------------", "stderr");
779+
println!("{}", err);
780+
println!("------------------------------------------");
782781
}
783782
}
784783

785-
fn error(err: ~str) { io::stdout().write_line(format!("\nerror: {}", err)); }
784+
fn error(err: ~str) { println!("\nerror: {}", err); }
786785

787786
fn fatal(err: ~str) -> ! { error(err); fail!(); }
788787

789788
fn fatal_ProcRes(err: ~str, ProcRes: &ProcRes) -> ! {
790-
let msg =
791-
format!("\n\
789+
print!("\n\
792790
error: {}\n\
793791
command: {}\n\
794792
stdout:\n\
@@ -801,7 +799,6 @@ stderr:\n\
801799
------------------------------------------\n\
802800
\n",
803801
err, ProcRes.cmdline, ProcRes.stdout, ProcRes.stderr);
804-
io::stdout().write_str(msg);
805802
fail!();
806803
}
807804

@@ -821,9 +818,9 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
821818
~[(~"",~"")], Some(~""));
822819

823820
if config.verbose {
824-
io::stdout().write_str(format!("push ({}) {} {} {}",
821+
println!("push ({}) {} {} {}",
825822
config.target, args.prog,
826-
copy_result.out, copy_result.err));
823+
copy_result.out, copy_result.err);
827824
}
828825

829826
logv(config, format!("executing ({}) {}", config.target, cmdline));
@@ -913,9 +910,9 @@ fn _arm_push_aux_shared_library(config: &config, testfile: &Path) {
913910
~[(~"",~"")], Some(~""));
914911

915912
if config.verbose {
916-
io::stdout().write_str(format!("push ({}) {} {} {}",
913+
println!("push ({}) {} {} {}",
917914
config.target, file.display(),
918-
copy_result.out, copy_result.err));
915+
copy_result.out, copy_result.err);
919916
}
920917
}
921918
}
@@ -999,7 +996,8 @@ fn disassemble_extract(config: &config, _props: &TestProps,
999996

1000997

1001998
fn count_extracted_lines(p: &Path) -> uint {
1002-
let x = io::read_whole_file_str(&p.with_extension("ll")).unwrap();
999+
let x = p.with_extension("ll").open_reader(io::Open).read_to_end();
1000+
let x = str::from_utf8_owned(x);
10031001
x.line_iter().len()
10041002
}
10051003

branches/try2/src/compiletest/util.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use common::config;
1212

13-
use std::io;
1413
use std::os::getenv;
1514

1615
/// Conversion table from triple OS name to Rust SYSNAME
@@ -64,5 +63,5 @@ pub fn path_div() -> ~str { ~";" }
6463
6564
pub fn logv(config: &config, s: ~str) {
6665
debug!("{}", s);
67-
if config.verbose { io::println(s); }
66+
if config.verbose { println(s); }
6867
}

branches/try2/src/etc/combine-tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ def scrub(b):
5656
d.write("extern mod extra;\n")
5757
d.write("extern mod run_pass_stage2;\n")
5858
d.write("use run_pass_stage2::*;\n")
59-
d.write("use std::io::WriterUtil;\n");
60-
d.write("use std::io;\n");
59+
d.write("use std::rt::io;\n");
60+
d.write("use std::rt::io::Writer;\n");
6161
d.write("fn main() {\n");
62-
d.write(" let out = io::stdout();\n");
62+
d.write(" let mut out = io::stdout();\n");
6363
i = 0
6464
for t in stage2_tests:
6565
p = os.path.join("test", "run-pass", t)
6666
p = p.replace("\\", "\\\\")
67-
d.write(" out.write_str(\"run-pass [stage2]: %s\\n\");\n" % p)
67+
d.write(" out.write(\"run-pass [stage2]: %s\\n\".as_bytes());\n" % p)
6868
d.write(" t_%d::main();\n" % i)
6969
i += 1
7070
d.write("}\n")

branches/try2/src/libextra/extra.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ pub use std::os;
4545
// Utility modules
4646

4747
pub mod c_vec;
48-
pub mod io_util;
4948

5049
// Concurrency
5150

@@ -104,7 +103,6 @@ pub mod rational;
104103
pub mod complex;
105104
pub mod stats;
106105
pub mod semver;
107-
pub mod fileinput;
108106
pub mod flate;
109107
pub mod hex;
110108
pub mod uuid;

0 commit comments

Comments
 (0)