Skip to content

Commit b899f79

Browse files
d3zd3zutzig
authored andcommitted
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: David Brown <david.brown@linaro.org>
1 parent 4b2547c commit b899f79

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ptest/src/main.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,14 @@ impl Matrix {
186186
None => continue,
187187
};
188188

189-
let fset = FeatureSet::decode(env)?;
189+
// Skip features not targeted to this build.
190+
let fset = match FeatureSet::decode(env) {
191+
Ok(fset) => fset,
192+
Err(err) => {
193+
warn!("Skipping: {:?}", err);
194+
continue;
195+
}
196+
};
190197
debug!("fset: {:?}", fset);
191198

192199
if false {
@@ -220,7 +227,9 @@ impl Matrix {
220227

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

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

0 commit comments

Comments
 (0)