| 1260 | "expected Halted(0), got {outcome:?}" |
| 1261 | ); |
| 1262 | } |
| 1263 | |
| 1264 | #[test] |
| 1265 | fn examples_exit_zero_in_vm() { |
| 1266 | // Derive the launchable set from the catalog so this gate never drifts from |
| 1267 | // what the application actually offers (see program_catalog.rs). |
| 1268 | use full_stack::program_catalog::{ProgramCatalog, ProgramKind}; |
| 1269 | let catalog = ProgramCatalog::default(); |
| 1270 | let examples = catalog.get_programs_by_kind(ProgramKind::Example); |
| 1271 | assert!(!examples.is_empty(), "catalog exposes no example programs"); |
| 1272 | |
| 1273 | for program in examples { |
| 1274 | // Use the import closure so examples may pull in qualified `import("...")` modules. |
| 1275 | let (outcome, uart) = |
| 1276 | run_hll_closure_with_path(&program.source, program.source_path.as_deref(), 50_000_000); |
| 1277 | assert!( |
| 1278 | matches!(outcome, RunOutcome::Halted(0)), |
| 1279 | "{}: expected Halted(0), got {outcome:?}\nuart:\n{uart}", |
| 1280 | program.name |
| 1281 | ); |