sim: Make the test builder optional
Some of the simulated devices aren't large enough to support the 5 slots
needed to test a multi-image configuration. To allow this to work, make
the return from the `ImagesBuilder` return an option, so that it will be
able to indicate (with `None`) that this configuration isn't possible to
test, and that the test should be skipped.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/src/lib.rs b/sim/src/lib.rs
index 58f5c59..43a1e5a 100644
--- a/sim/src/lib.rs
+++ b/sim/src/lib.rs
@@ -161,7 +161,13 @@
pub fn run_single(&mut self, device: DeviceName, align: u8, erased_val: u8) {
warn!("Running on device {} with alignment {}", device, align);
- let run = ImagesBuilder::new(device, align, erased_val);
+ let run = match ImagesBuilder::new(device, align, erased_val) {
+ Some(builder) => builder,
+ None => {
+ warn!("Skipping device with insuffienct partitions");
+ return;
+ }
+ };
let mut failed = false;