Commit b899f79a authored by David Brown's avatar David Brown Committed by Fabio Utzig
Browse files

ptest: Support new format of .travis.yml

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: default avatarDavid Brown <david.brown@linaro.org>
parent 4b2547c7
Loading
Loading
Loading
Loading
+12 −3
Changes for ptest/src/main.rs: 12 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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 {
@@ -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)),
@@ -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()?;