Fix test case header parsing code in presence of multiple revisions.
The previous code would parse the TestProps, and then parse them again with a revision set, adding some elements (like aux_builds) a second time to the existing TestProps.
This commit is contained in:
parent
968b6206cb
commit
6a9fa50f4a
@ -259,9 +259,9 @@ impl TestProps {
|
|||||||
props
|
props
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_file(testfile: &Path, config: &Config) -> Self {
|
pub fn from_file(testfile: &Path, cfg: Option<&str>, config: &Config) -> Self {
|
||||||
let mut props = TestProps::new();
|
let mut props = TestProps::new();
|
||||||
props.load_from(testfile, None, config);
|
props.load_from(testfile, cfg, config);
|
||||||
props
|
props
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,10 +269,10 @@ impl TestProps {
|
|||||||
/// tied to a particular revision `foo` (indicated by writing
|
/// tied to a particular revision `foo` (indicated by writing
|
||||||
/// `//[foo]`), then the property is ignored unless `cfg` is
|
/// `//[foo]`), then the property is ignored unless `cfg` is
|
||||||
/// `Some("foo")`.
|
/// `Some("foo")`.
|
||||||
pub fn load_from(&mut self,
|
fn load_from(&mut self,
|
||||||
testfile: &Path,
|
testfile: &Path,
|
||||||
cfg: Option<&str>,
|
cfg: Option<&str>,
|
||||||
config: &Config) {
|
config: &Config) {
|
||||||
iter_header(testfile,
|
iter_header(testfile,
|
||||||
cfg,
|
cfg,
|
||||||
&mut |ln| {
|
&mut |ln| {
|
||||||
|
@ -69,7 +69,7 @@ pub fn run(config: Config, testpaths: &TestPaths) {
|
|||||||
print!("\n\n");
|
print!("\n\n");
|
||||||
}
|
}
|
||||||
debug!("running {:?}", testpaths.file.display());
|
debug!("running {:?}", testpaths.file.display());
|
||||||
let base_props = TestProps::from_file(&testpaths.file, &config);
|
let base_props = TestProps::from_file(&testpaths.file, None, &config);
|
||||||
|
|
||||||
let base_cx = TestCx { config: &config,
|
let base_cx = TestCx { config: &config,
|
||||||
props: &base_props,
|
props: &base_props,
|
||||||
@ -81,8 +81,9 @@ pub fn run(config: Config, testpaths: &TestPaths) {
|
|||||||
base_cx.run_revision()
|
base_cx.run_revision()
|
||||||
} else {
|
} else {
|
||||||
for revision in &base_props.revisions {
|
for revision in &base_props.revisions {
|
||||||
let mut revision_props = base_props.clone();
|
let revision_props = TestProps::from_file(&testpaths.file,
|
||||||
revision_props.load_from(&testpaths.file, Some(revision), &config);
|
Some(revision),
|
||||||
|
&config);
|
||||||
let rev_cx = TestCx {
|
let rev_cx = TestCx {
|
||||||
config: &config,
|
config: &config,
|
||||||
props: &revision_props,
|
props: &revision_props,
|
||||||
@ -2614,4 +2615,4 @@ fn read2_abbreviated(mut child: Child) -> io::Result<Output> {
|
|||||||
stdout: stdout.into_bytes(),
|
stdout: stdout.into_bytes(),
|
||||||
stderr: stderr.into_bytes(),
|
stderr: stderr.into_bytes(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user