From 080bd97781ee419722df8394a0155b5db069a490 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Thu, 10 Mar 2016 13:08:20 +0200 Subject: [PATCH] compiletest: Add rustc-env for run-pass/super-fast-paren-parsing. --- src/compiletest/header.rs | 13 ++++++++++--- src/compiletest/runtest.rs | 2 +- src/test/run-pass/super-fast-paren-parsing.rs | 1 + 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, // Modules from aux directory that should be compiled pub aux_builds: Vec , + // 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 = 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... -- 2.44.0