| 162 | // clean spawn-and-exit. |
| 163 | fn run_example_in_kernel(user_src: &str, label: &str) { |
| 164 | let user = compile_hosted(user_src); |
| 165 | let (_, outcome, uart) = boot_kernel(cached_kernel(), Some(&user), None, "", 10_000_000); |
| 166 | assert_user_exit_ok(&uart, &outcome, label); |
| 167 | } |
| 168 | |
| 169 | fn run_example_manifest_in_kernel(name: &str) { |
| 170 | let manifest_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) |
| 171 | .join("programs/example") |
| 172 | .join(name) |
| 173 | .join(format!("{name}.build")); |
| 174 | let manifest = BuildManifest::from_file(&manifest_path) |
| 175 | .unwrap_or_else(|e| panic!("{}: parse failed: {e}", manifest_path.display())); |
| 176 | let user = BuildExecutor::build(&manifest) |
| 177 | .unwrap_or_else(|e| panic!("{}: build failed: {e}", manifest_path.display())) |
| 178 | .linked; |
| 179 | let (_, outcome, uart) = boot_kernel(cached_kernel(), Some(&user), None, "", 10_000_000); |