about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2016-03-10 13:08:20 +0200
committerEduard Burtescu <edy.burt@gmail.com>2016-03-17 22:48:07 +0200
commit080bd97781ee419722df8394a0155b5db069a490 (patch)
tree71ab89c8431aef68549f69526d4a958011aa1dc2
parent5f990fb4f000077216d96bf31ea33623a9875e9e (diff)
downloadrust-080bd97781ee419722df8394a0155b5db069a490.tar.gz
rust-080bd97781ee419722df8394a0155b5db069a490.zip
compiletest: Add rustc-env for run-pass/super-fast-paren-parsing.
-rw-r--r--src/compiletest/header.rs13
-rw-r--r--src/compiletest/runtest.rs2
-rw-r--r--src/test/run-pass/super-fast-paren-parsing.rs1
3 files changed, 12 insertions, 4 deletions
diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs
index cf4d545a827..ef93fcfa013 100644
--- a/src/compiletest/header.rs
+++ b/src/compiletest/header.rs
@@ -31,6 +31,8 @@ pub struct TestProps {
     pub pp_exact: Option<PathBuf>,
     // Modules from aux directory that should be compiled
     pub aux_builds: Vec<String> ,
+    // Environment settings to use for compiling
+    pub rustc_env: Vec<(String,String)> ,
     // Environment settings to use during execution
     pub exec_env: Vec<(String,String)> ,
     // Lines to check if they appear in the expected debugger output
@@ -77,6 +79,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
         pp_exact: pp_exact,
         aux_builds: aux_builds,
         revisions: vec![],
+        rustc_env: vec![],
         exec_env: exec_env,
         check_lines: check_lines,
         build_aux_docs: build_aux_docs,
@@ -153,10 +156,14 @@ pub fn load_props_into(props: &mut TestProps, testfile: &Path, cfg: Option<&str>
             props.aux_builds.push(ab);
         }
 
-        if let Some(ee) = parse_exec_env(ln) {
+        if let Some(ee) = parse_env(ln, "exec-env") {
             props.exec_env.push(ee);
         }
 
+        if let Some(ee) = parse_env(ln, "rustc-env") {
+            props.rustc_env.push(ee);
+        }
+
         if let Some(cl) =  parse_check_line(ln) {
             props.check_lines.push(cl);
         }
@@ -372,8 +379,8 @@ fn parse_pretty_compare_only(line: &str) -> bool {
     parse_name_directive(line, "pretty-compare-only")
 }
 
-fn parse_exec_env(line: &str) -> Option<(String, String)> {
-    parse_name_value_directive(line, "exec-env").map(|nv| {
+fn parse_env(line: &str, name: &str) -> Option<(String, String)> {
+    parse_name_value_directive(line, name).map(|nv| {
         // nv is either FOO or FOO=BAR
         let mut strs: Vec<String> = nv
                                       .splitn(2, '=')
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index 8c3ee3fb5f4..1d1f5489c48 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -1386,7 +1386,7 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
     compose_and_run(config,
                     testpaths,
                     args,
-                    Vec::new(),
+                    props.rustc_env.clone(),
                     &config.compile_lib_path,
                     Some(aux_dir.to_str().unwrap()),
                     input)
diff --git a/src/test/run-pass/super-fast-paren-parsing.rs b/src/test/run-pass/super-fast-paren-parsing.rs
index 69ec0a2222d..b764a983a0c 100644
--- a/src/test/run-pass/super-fast-paren-parsing.rs
+++ b/src/test/run-pass/super-fast-paren-parsing.rs
@@ -11,6 +11,7 @@
 // ignore-pretty
 //
 // exec-env:RUST_MIN_STACK=16000000
+// rustc-env:RUST_MIN_STACK=16000000
 //
 // Big stack is needed for pretty printing, a little sad...