()
| 241 | // All of these formerly recompiled the kernel and asserted on different parts of |
| 242 | // the same boot. One boot now covers the whole sequence. |
| 243 | |
| 244 | #[test] |
| 245 | fn kernel_boot_full_sequence() { |
| 246 | let user = compile_hosted(user::USER_HELLO); |
| 247 | let (_, outcome, uart) = boot_kernel(cached_kernel(), Some(&user), None, "", 10_000_000); |
| 248 | |
| 249 | match outcome { |
| 250 | StepOutcome::Continue => {} // idle loop, expected |
| 251 | StepOutcome::Halted(c) => panic!("unexpected halt with code {c}; uart={uart:?}"), |
| 252 | } |
| 253 | |
| 254 | // Banner and init order: console -> device tree -> memory diagnostics. |
| 255 | assert!( |
| 256 | uart.contains("[ OK ] kernel starting\n"), |
| 257 | "expected boot banner; uart={uart:?}" |
| 258 | ); |
| 259 | let console_pos = uart |
| 260 | .find("[ OK ] console online\n") |
| 261 | .expect("console online missing"); |
| 262 | let dt_pos = uart |
| 263 | .find("[ WARN ] device tree:") |
| 264 | .expect("device tree warn missing"); |
| 265 | let mem_pos = uart |
| 266 | .find("[ OK ] running memory diagnostics...\n") |
| 267 | .expect("memory diagnostics missing"); |
| 268 | assert!( |
| 269 | console_pos < dt_pos && dt_pos < mem_pos, |
| 270 | "init order wrong: console={console_pos} dt={dt_pos} mem={mem_pos}" |
| 271 | ); |
| 272 | |
| 273 | // Self-tests and arming. |
| 274 | assert!( |
| 275 | uart.contains("[ OK ] memory self-test passed\n"), |
| 276 | "expected memory self-test to pass; uart={uart:?}" |
| 277 | ); |
| 278 | assert!( |
| 279 | !uart.contains("memory self-test failed"), |
| 280 | "memory self-test must not fail; uart={uart:?}" |
| 281 | ); |
| 282 | assert!( |
| 283 | uart.contains("[ OK ] heap ready\n"), |
| 284 | "expected heap smoke-test; uart={uart:?}" |
| 285 | ); |
| 286 | assert!( |
| 287 | uart.contains("[ OK ] timer armed\n"), |
| 288 | "expected timer armed; uart={uart:?}" |
| 289 | ); |
| 290 | assert!( |
| 291 | uart.contains("[ OK ] boot complete\n"), |
| 292 | "expected boot complete; uart={uart:?}" |
| 293 | ); |
| 294 | |
| 295 | // User process spawns and greets. |
| 296 | assert!( |
| 297 | uart.contains("[ PROC ] pid 1 ready"), |
| 298 | "expected user process spawn; uart={uart:?}" |
| 299 | ); |
| 300 | assert!( |
nothing calls this directly
no test coverage detected