sim: add unsupported caps to device creation
Update `make_device` to return a slice of unsupported caps for a test.
This allows skipping tests in devices that are known to be non working
under some build configuration.
The device constructor was updated to return a `Result`, so that the
specific reason for skipping can be returned as a `String`.
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/src/lib.rs b/sim/src/lib.rs
index fda376a..dba7cb0 100644
--- a/sim/src/lib.rs
+++ b/sim/src/lib.rs
@@ -173,9 +173,9 @@
warn!("Running on device {} with alignment {}", device, align);
let run = match ImagesBuilder::new(device, align, erased_val) {
- Some(builder) => builder,
- None => {
- warn!("Skipping device with insuffienct partitions");
+ Ok(builder) => builder,
+ Err(msg) => {
+ warn!("Skipping {}: {}", device, msg);
return;
}
};