File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed
test_kernels/ramdisk/src/bin Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1+ use std:: path:: Path ;
2+
13use bootloader_test_runner:: run_test_kernel;
24static RAMDISK_PATH : & str = "tests/ramdisk.txt" ;
35
46#[ test]
57fn basic_boot ( ) {
68 run_test_kernel (
79 env ! ( "CARGO_BIN_FILE_TEST_KERNEL_RAMDISK_basic_boot" ) ,
8- Some ( RAMDISK_PATH ) ,
10+ Some ( & Path :: new ( RAMDISK_PATH ) ) ,
911 ) ;
1012}
1113
1214#[ test]
1315fn check_ramdisk ( ) {
1416 run_test_kernel (
1517 env ! ( "CARGO_BIN_FILE_TEST_KERNEL_RAMDISK_ramdisk" ) ,
16- Some ( RAMDISK_PATH ) ,
18+ Some ( & Path :: new ( RAMDISK_PATH ) ) ,
1719 ) ;
1820}
Original file line number Diff line number Diff line change @@ -10,12 +10,8 @@ const QEMU_ARGS: &[&str] = &[
1010 "--no-reboot" ,
1111] ;
1212
13- pub fn run_test_kernel ( kernel_binary_path : & str , ramdisk_path : Option < & str > ) {
13+ pub fn run_test_kernel ( kernel_binary_path : & str , ramdisk_path : Option < & Path > ) {
1414 let kernel_path = Path :: new ( kernel_binary_path) ;
15- let ramdisk_path = match ramdisk_path {
16- Some ( rdp) => Some ( Path :: new ( rdp) ) ,
17- None => None ,
18- } ;
1915
2016 // create an MBR disk image for legacy BIOS booting
2117 let mbr_path = kernel_path. with_extension ( "mbr" ) ;
Original file line number Diff line number Diff line change @@ -27,8 +27,6 @@ fn kernel_main(boot_info: &'static mut BootInfo) -> ! {
2727#[ cfg( not( test) ) ]
2828#[ panic_handler]
2929fn panic ( info : & core:: panic:: PanicInfo ) -> ! {
30- use core:: fmt:: Write ;
31-
3230 let _ = writeln ! ( test_kernel_ramdisk:: serial( ) , "PANIC: {}" , info) ;
3331 exit_qemu ( QemuExitCode :: Failed ) ;
3432}
You can’t perform that action at this time.
0 commit comments