@@ -31,6 +31,8 @@ pub struct TestProps {
31
31
pub pp_exact: Option<PathBuf>,
32
32
// Modules from aux directory that should be compiled
33
33
pub aux_builds: Vec<String> ,
34
+ // Environment settings to use for compiling
35
+ pub rustc_env: Vec<(String,String)> ,
34
36
// Environment settings to use during execution
35
37
pub exec_env: Vec<(String,String)> ,
36
38
// Lines to check if they appear in the expected debugger output
@@ -77,6 +79,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
77
79
pp_exact: pp_exact,
78
80
aux_builds: aux_builds,
79
81
revisions: vec![],
82
+ rustc_env: vec![],
80
83
exec_env: exec_env,
81
84
check_lines: check_lines,
82
85
build_aux_docs: build_aux_docs,
@@ -153,10 +156,14 @@ pub fn load_props_into(props: &mut TestProps, testfile: &Path, cfg: Option<&str>
153
156
props.aux_builds.push(ab);
154
157
}
155
158
156
- if let Some(ee) = parse_exec_env (ln) {
159
+ if let Some(ee) = parse_env (ln, "exec-env" ) {
157
160
props.exec_env.push(ee);
158
161
}
159
162
163
+ if let Some(ee) = parse_env(ln, "rustc-env") {
164
+ props.rustc_env.push(ee);
165
+ }
166
+
160
167
if let Some(cl) = parse_check_line(ln) {
161
168
props.check_lines.push(cl);
162
169
}
@@ -372,8 +379,8 @@ fn parse_pretty_compare_only(line: &str) -> bool {
372
379
parse_name_directive(line, "pretty-compare-only")
373
380
}
374
381
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| {
377
384
// nv is either FOO or FOO=BAR
378
385
let mut strs: Vec<String> = nv
379
386
.splitn(2, '=')
0 commit comments