about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-07-31 19:12:33 -0700
committerBrian Anderson <banderson@mozilla.com>2011-08-02 10:39:13 -0700
commita601eb169ee5748b7afebab12d75ecc3ad3b47bc (patch)
treed13ec4a2bf4bc9ec97511e0e3f1f4dc564f442bd /src
parent59691b084fd64c6e98c36f8c738abe4a6fe6f89e (diff)
downloadrust-a601eb169ee5748b7afebab12d75ecc3ad3b47bc.tar.gz
rust-a601eb169ee5748b7afebab12d75ecc3ad3b47bc.zip
Run pretty-printed sources through the compiler again for sanity
Just go as far as typechecking for speed sake.

Issue #789
Diffstat (limited to 'src')
-rw-r--r--src/test/compiletest/runtest.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/test/compiletest/runtest.rs b/src/test/compiletest/runtest.rs
index 328b1e7f6cb..50f61575a91 100644
--- a/src/test/compiletest/runtest.rs
+++ b/src/test/compiletest/runtest.rs
@@ -100,7 +100,7 @@ fn run_pretty_test(cx: &cx, props: &test_props, testfile: &str) {
     compare_source(expected, actual);
 
     // Finally, let's make sure it actually appears to remain valid code
-    let procres = typecheck_source(cx, actual);
+    let procres = typecheck_source(cx, testfile, actual);
 
     if procres.status != 0 {
         fatal_procres("pretty-printed source does not typecheck",
@@ -139,9 +139,15 @@ actual:\n\
         }
     }
 
-    fn typecheck_source(cx: &cx, src: &str) -> procres {
-        // FIXME
-        ret {status: 0, stdout: src, stderr: "", cmdline: ""};
+    fn typecheck_source(cx: &cx, testfile: &str, src: &str) -> procres {
+        compose_and_run(cx, testfile, make_typecheck_args,
+                        cx.config.compile_lib_path, option::some(src))
+    }
+
+    fn make_typecheck_args(config: &config, testfile: &str) -> procargs {
+        let prog = config.rustc_path;
+        let args = ["-", "--no-trans"];
+        ret {prog: prog, args: args};
     }
 }