From 75d33cfa649610d4d8908bac2491a2ccced525f5 Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 25 Jun 2018 22:04:08 -0500 Subject: add edition compiletest header + fix tests --- src/tools/compiletest/src/header.rs | 14 +++++++++++--- src/tools/compiletest/src/runtest.rs | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/tools/compiletest') 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 { + 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") -- cgit 1.4.1-3-g733a5