Skip to content

Commit a601eb1

Browse files
committed
Run pretty-printed sources through the compiler again for sanity
Just go as far as typechecking for speed sake. Issue #789
1 parent 59691b0 commit a601eb1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/test/compiletest/runtest.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn run_pretty_test(cx: &cx, props: &test_props, testfile: &str) {
100100
compare_source(expected, actual);
101101

102102
// Finally, let's make sure it actually appears to remain valid code
103-
let procres = typecheck_source(cx, actual);
103+
let procres = typecheck_source(cx, testfile, actual);
104104

105105
if procres.status != 0 {
106106
fatal_procres("pretty-printed source does not typecheck",
@@ -139,9 +139,15 @@ actual:\n\
139139
}
140140
}
141141

142-
fn typecheck_source(cx: &cx, src: &str) -> procres {
143-
// FIXME
144-
ret {status: 0, stdout: src, stderr: "", cmdline: ""};
142+
fn typecheck_source(cx: &cx, testfile: &str, src: &str) -> procres {
143+
compose_and_run(cx, testfile, make_typecheck_args,
144+
cx.config.compile_lib_path, option::some(src))
145+
}
146+
147+
fn make_typecheck_args(config: &config, testfile: &str) -> procargs {
148+
let prog = config.rustc_path;
149+
let args = ["-", "--no-trans"];
150+
ret {prog: prog, args: args};
145151
}
146152
}
147153

0 commit comments

Comments
 (0)