diff options
| author | mark <markm@cs.wisc.edu> | 2018-06-25 22:04:08 -0500 |
|---|---|---|
| committer | mark <markm@cs.wisc.edu> | 2018-06-26 19:32:00 -0500 |
| commit | 75d33cfa649610d4d8908bac2491a2ccced525f5 (patch) | |
| tree | f8789ce5b317cadb63329ecf6436268c3f43d833 /src/tools/compiletest | |
| parent | 2a1c4eec40527de45b9d9b81672c8b9220d554fc (diff) | |
| download | rust-75d33cfa649610d4d8908bac2491a2ccced525f5.tar.gz rust-75d33cfa649610d4d8908bac2491a2ccced525f5.zip | |
add edition compiletest header + fix tests
Diffstat (limited to 'src/tools/compiletest')
| -rw-r--r-- | src/tools/compiletest/src/header.rs | 14 | ||||
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index f66f5c5b70e..1dd7fe7f0cb 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -298,6 +298,10 @@ impl TestProps { .extend(flags.split_whitespace().map(|s| s.to_owned())); } + if let Some(edition) = config.parse_edition(ln) { + self.compile_flags.push(format!("--edition={}", edition)); + } + if let Some(r) = config.parse_revisions(ln) { self.revisions.extend(r); } @@ -371,9 +375,9 @@ impl TestProps { self.compile_pass = config.parse_compile_pass(ln) || self.run_pass; } - if !self.skip_codegen { - self.skip_codegen = config.parse_skip_codegen(ln); - } + if !self.skip_codegen { + self.skip_codegen = config.parse_skip_codegen(ln); + } if !self.disable_ui_testing_normalization { self.disable_ui_testing_normalization = @@ -647,6 +651,10 @@ impl Config { fn parse_run_rustfix(&self, line: &str) -> bool { self.parse_name_directive(line, "run-rustfix") } + + fn parse_edition(&self, line: &str) -> Option<String> { + self.parse_name_value_directive(line, "edition") + } } pub fn lldb_version_to_int(version_string: &str) -> isize { diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index caf73f4f68b..408eda5ba5b 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1368,6 +1368,7 @@ impl<'test> TestCx<'test> { .arg(out_dir) .arg(&self.testpaths.file) .args(&self.props.compile_flags); + if let Some(ref linker) = self.config.linker { rustdoc .arg("--linker") |
