]> git.lizzy.rs Git - rust.git/commitdiff
compiletest: Add rustc-env for run-pass/super-fast-paren-parsing.
authorEduard Burtescu <edy.burt@gmail.com>
Thu, 10 Mar 2016 11:08:20 +0000 (13:08 +0200)
committerEduard Burtescu <edy.burt@gmail.com>
Thu, 17 Mar 2016 20:48:07 +0000 (22:48 +0200)
src/compiletest/header.rs
src/compiletest/runtest.rs
src/test/run-pass/super-fast-paren-parsing.rs

index cf4d545a827c168972311ebaf3ec1e65bc1e7159..ef93fcfa013f89f10b99c00917a462cbe21aea18 100644 (file)
@@ -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> ,
     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
     // 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![],
         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,
         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);
         }
 
             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);
         }
 
             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);
         }
         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")
 }
 
     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, '=')
         // nv is either FOO or FOO=BAR
         let mut strs: Vec<String> = nv
                                       .splitn(2, '=')
index 8c3ee3fb5f4b6f373da59026ccf244da87bb2bd8..1d1f5489c48f304ffe23838515f0aeaa17eda68d 100644 (file)
@@ -1386,7 +1386,7 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
     compose_and_run(config,
                     testpaths,
                     args,
     compose_and_run(config,
                     testpaths,
                     args,
-                    Vec::new(),
+                    props.rustc_env.clone(),
                     &config.compile_lib_path,
                     Some(aux_dir.to_str().unwrap()),
                     input)
                     &config.compile_lib_path,
                     Some(aux_dir.to_str().unwrap()),
                     input)
index 69ec0a2222ddbc50e84ba5b22c26e129e97e30dc..b764a983a0c0960aa872a4c00c0982f5cc7f0456 100644 (file)
@@ -11,6 +11,7 @@
 // ignore-pretty
 //
 // exec-env:RUST_MIN_STACK=16000000
 // ignore-pretty
 //
 // exec-env:RUST_MIN_STACK=16000000
+// rustc-env:RUST_MIN_STACK=16000000
 //
 // Big stack is needed for pretty printing, a little sad...
 
 //
 // Big stack is needed for pretty printing, a little sad...