Skip to content

Commit 22b3c70

Browse files
committed
compiletest: Add rustc-env for run-pass/super-fast-paren-parsing.
1 parent 9336805 commit 22b3c70

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/compiletest/header.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ pub struct TestProps {
3131
pub pp_exact: Option<PathBuf>,
3232
// Modules from aux directory that should be compiled
3333
pub aux_builds: Vec<String> ,
34+
// Environment settings to use for compiling
35+
pub rustc_env: Vec<(String,String)> ,
3436
// Environment settings to use during execution
3537
pub exec_env: Vec<(String,String)> ,
3638
// Lines to check if they appear in the expected debugger output
@@ -77,6 +79,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
7779
pp_exact: pp_exact,
7880
aux_builds: aux_builds,
7981
revisions: vec![],
82+
rustc_env: vec![],
8083
exec_env: exec_env,
8184
check_lines: check_lines,
8285
build_aux_docs: build_aux_docs,
@@ -153,10 +156,14 @@ pub fn load_props_into(props: &mut TestProps, testfile: &Path, cfg: Option<&str>
153156
props.aux_builds.push(ab);
154157
}
155158

156-
if let Some(ee) = parse_exec_env(ln) {
159+
if let Some(ee) = parse_env(ln, "exec-env") {
157160
props.exec_env.push(ee);
158161
}
159162

163+
if let Some(ee) = parse_env(ln, "rustc-env") {
164+
props.rustc_env.push(ee);
165+
}
166+
160167
if let Some(cl) = parse_check_line(ln) {
161168
props.check_lines.push(cl);
162169
}
@@ -372,8 +379,8 @@ fn parse_pretty_compare_only(line: &str) -> bool {
372379
parse_name_directive(line, "pretty-compare-only")
373380
}
374381

375-
fn parse_exec_env(line: &str) -> Option<(String, String)> {
376-
parse_name_value_directive(line, "exec-env").map(|nv| {
382+
fn parse_env(line: &str, name: &str) -> Option<(String, String)> {
383+
parse_name_value_directive(line, name).map(|nv| {
377384
// nv is either FOO or FOO=BAR
378385
let mut strs: Vec<String> = nv
379386
.splitn(2, '=')

src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
13861386
compose_and_run(config,
13871387
testpaths,
13881388
args,
1389-
Vec::new(),
1389+
props.rustc_env.clone(),
13901390
&config.compile_lib_path,
13911391
Some(aux_dir.to_str().unwrap()),
13921392
input)

src/test/run-pass/super-fast-paren-parsing.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// ignore-pretty
1212
//
1313
// exec-env:RUST_MIN_STACK=16000000
14+
// rustc-env:RUST_MIN_STACK=16000000
1415
//
1516
// Big stack is needed for pretty printing, a little sad...
1617

0 commit comments

Comments
 (0)