Skip to content

Commit

Permalink
ptest: Support new format of .travis.yml
Browse files Browse the repository at this point in the history
The change "Add Mynewt target builds to CI" changes the format of the
.travis.yml file a bit.  Fix up the ptest utility so that it is still
able to run the simulator tests.

Signed-off-by: David Brown <david.brown@linaro.org>
  • Loading branch information
d3zd3z authored and utzig committed Mar 15, 2019
1 parent 4b2547c commit b899f79
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ptest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,14 @@ impl Matrix {
None => continue,
};

let fset = FeatureSet::decode(env)?;
// Skip features not targeted to this build.
let fset = match FeatureSet::decode(env) {
Ok(fset) => fset,
Err(err) => {
warn!("Skipping: {:?}", err);
continue;
}
};
debug!("fset: {:?}", fset);

if false {
Expand Down Expand Up @@ -220,7 +227,9 @@ impl Matrix {

impl FeatureSet {
fn decode(text: &str) -> Result<FeatureSet> {
let re = Regex::new(r#"^([A-Z_]+)="(.*)"$"#)?;
// This is not general environment settings, but specific to the
// travis file.
let re = Regex::new(r#"^([A-Z_]+)="(.*)" TEST=sim$"#)?;

match re.captures(text) {
None => Err(format_err!("Invalid line: {:?}", text)),
Expand All @@ -246,7 +255,7 @@ impl FeatureSet {
fn run(&self) -> Result<Option<Output>> {
for v in &self.values {
let output = Command::new("bash")
.arg("./scripts/run_tests.sh")
.arg("./ci/sim_run.sh")
.current_dir("..")
.env(&self.env, v)
.output()?;
Expand Down

0 comments on commit b899f79

Please sign in to comment.