MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / kernel_shell_ls_cd_run_exit

Function kernel_shell_ls_cd_run_exit

tests/integration/kernel_integration.rs:718–770  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

716 cached_kernel(),
717 Some(&shell),
718 Some(&image),
719 session,
720 80_000_000,
721 );
722
723 assert!(!uart.contains("PANIC!"), "kernel panicked; uart={uart:?}");
724 assert!(
725 uart.contains("HLL shell ready"),
726 "shell did not start; uart={uart:?}"
727 );
728 assert!(
729 uart.contains("home"),
730 "ls of root did not list home; uart={uart:?}"
731 );
732 assert!(
733 uart.contains("hello.elf"),
734 "ls of /home did not list the program; uart={uart:?}"
735 );
736 assert!(
737 uart.contains("HELLO_FROM_CHILD"),
738 "run did not execute the program; uart={uart:?}"
739 );
740 assert!(
741 matches!(outcome, StepOutcome::Halted(0)),
742 "exit did not halt the VM cleanly; outcome={outcome:?} uart={uart:?}"
743 );
744}
745
746// Non-zero global initializers must survive the ELF/sys_exec load path too, not
747// just the direct VM loader the run_hll tests cover.
748#[test]
749fn kernel_shell_exec_carries_global_initializers() {
750 let shell = compile_hosted_program("shell");
751
752 let child = compile_hosted(
753 r#"
754external print_int: (value: i64) -> i32
755external console_writeln: (str: u8*)
756g: i64 = 12345
757arr: i64[3] = [100, 200, 300]
758main: () -> i32 {
759 console_writeln("SCALAR".ptr)
760 print_int(g)
761 console_writeln("ARRAY".ptr)
762 print_int(arr[0] + arr[1] + arr[2])
763 return 0
764}
765"#,
766 );
767 let exec_file = assembled_to_elf_file(&child);
768
769 let image = build_fs_image(&[FsEntry::File {
770 path: "/g.elf",
771 data: &exec_file,
772 }]);
773

Callers

nothing calls this directly

Calls 6

compile_hosted_programFunction · 0.85
compile_hostedFunction · 0.85
assembled_to_elf_fileFunction · 0.85
build_fs_imageFunction · 0.85
boot_kernelFunction · 0.85
cached_kernelFunction · 0.85

Tested by

no test coverage detected