pub forbid_output: Vec<String>,
// Revisions to test for incremental compilation.
pub revisions: Vec<String>,
+ // Directory (if any) to use for incremental compilation. This is
+ // not set by end-users; rather it is set by the incremental
+ // testing harness and used when generating compilation
+ // arguments. (In particular, it propagates to the aux-builds.)
+ pub incremental_dir: Option<PathBuf>,
}
impl TestProps {
pretty_mode: format!("normal"),
pretty_compare_only: pretty_compare_only,
forbid_output: forbid_output,
+ incremental_dir: None,
}
}
+ pub fn from_aux_file(&self, testfile: &Path, cfg: Option<&str>) -> Self {
+ let mut props = TestProps::new();
+
+ // copy over select properties to the aux build:
+ props.incremental_dir = self.incremental_dir.clone();
+ props.load_from(testfile, cfg);
+
+ props
+ }
+
pub fn from_file(testfile: &Path) -> Self {
let mut props = TestProps::new();
props.load_from(testfile, None);
for revision in &base_props.revisions {
let mut revision_props = base_props.clone();
revision_props.load_from(&testpaths.file, Some(&revision));
- revision_props.compile_flags.extend(vec![
- format!("--cfg"),
- format!("{}", revision),
- ]);
let rev_cx = TestCx {
config: &config,
props: &revision_props,
self.config.build_base.to_str().unwrap().to_owned(),
"-L".to_owned(),
aux_dir.to_str().unwrap().to_owned());
+ if let Some(revision) = self.revision {
+ args.extend(vec![
+ format!("--cfg"),
+ format!("{}", revision),
+ ]);
+ }
args.extend(self.split_maybe_args(&self.config.target_rustcflags));
args.extend(self.props.compile_flags.iter().cloned());
// FIXME (#9639): This needs to handle non-utf8 paths
if self.props.build_aux_docs {
for rel_ab in &self.props.aux_builds {
let aux_testpaths = self.compute_aux_test_paths(rel_ab);
- let aux_props = TestProps::from_file(&aux_testpaths.file);
+ let aux_props = self.props.from_aux_file(&aux_testpaths.file, self.revision);
let aux_cx = TestCx {
config: self.config,
props: &aux_props,
for rel_ab in &self.props.aux_builds {
let aux_testpaths = self.compute_aux_test_paths(rel_ab);
- let aux_props = TestProps::from_file(&aux_testpaths.file);
+ let aux_props = self.props.from_aux_file(&aux_testpaths.file, self.revision);
let mut crate_type = if aux_props.no_prefer_dynamic {
Vec::new()
} else {
self.config.build_base.to_str().unwrap().to_owned(),
format!("--target={}", target));
+ if let Some(revision) = self.revision {
+ args.extend(vec![
+ format!("--cfg"),
+ format!("{}", revision),
+ ]);
+ }
+
+ if let Some(ref incremental_dir) = self.props.incremental_dir {
+ args.extend(vec![
+ format!("-Z"),
+ format!("incremental={}", incremental_dir.display()),
+ ]);
+ }
+
+
match self.config.mode {
CompileFail |
ParseFail |
// Add an extra flag pointing at the incremental directory.
let mut revision_props = self.props.clone();
- revision_props.compile_flags.extend(vec![
- format!("-Z"),
- format!("incremental={}", incremental_dir.display()),
- ]);
+ revision_props.incremental_dir = Some(incremental_dir);
let revision_cx = TestCx {
config: self.config,