diff options
| author | datdenkikniet <jcdra1@gmail.com> | 2023-04-15 22:40:25 +0200 |
|---|---|---|
| committer | datdenkikniet <jcdra1@gmail.com> | 2023-04-16 13:08:46 +0200 |
| commit | deeb3877f061fb71389ec7730c6c21e81e9e3050 (patch) | |
| tree | f843398602d036f83b74c02999df006eefab8f2d /xtask/src/cargo_commands.rs | |
| parent | 1c84ccf6e4169b4b45f0e22e709e4265a10324a5 (diff) | |
Improve locality of error messages & ExampleBuild + Qemu commands, and
indicate failure earlier
Diffstat (limited to 'xtask/src/cargo_commands.rs')
| -rw-r--r-- | xtask/src/cargo_commands.rs | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/xtask/src/cargo_commands.rs b/xtask/src/cargo_commands.rs index 42895d8..2e30997 100644 --- a/xtask/src/cargo_commands.rs +++ b/xtask/src/cargo_commands.rs @@ -312,30 +312,36 @@ pub fn qemu_run_examples<'c>( let target = backend.to_target(); let features = Some(target.and_features(backend.to_rtic_feature())); - let build = examples_iter(examples).map(|example| { - let cmd_build = CargoCommand::ExampleBuild { - // We need to be in the correct - cargoarg: &None, - example, - target, - features: features.clone(), - mode: BuildMode::Release, - }; - (globals, cmd_build, overwrite) - }); + examples_iter(examples) + .flat_map(|example| { + let cmd_build = CargoCommand::ExampleBuild { + cargoarg: &None, + example, + target, + features: features.clone(), + mode: BuildMode::Release, + }; - let run = examples_iter(examples).map(|example| { - let cmd_qemu = CargoCommand::Qemu { - cargoarg, - example, - target, - features: features.clone(), - mode: BuildMode::Release, - }; - (globals, cmd_qemu, overwrite) - }); + let cmd_qemu = CargoCommand::Qemu { + cargoarg, + example, + target, + features: features.clone(), + mode: BuildMode::Release, + }; + + #[cfg(not(feature = "rayon"))] + { + [cmd_build, cmd_qemu].into_iter() + } - build.chain(run).run_and_coalesce() + #[cfg(feature = "rayon")] + { + [cmd_build, cmd_qemu].into_par_iter() + } + }) + .map(|cmd| (globals, cmd, overwrite)) + .run_and_coalesce() } /// Check the binary sizes of examples |
