rust-osdev / bootloader

An experimental pure-Rust x86 bootloader
Apache License 2.0
1.39k stars 212 forks source link

Features and tests #405

Closed m-mueller678 closed 10 months ago

m-mueller678 commented 12 months ago

It looks like the tests currently don't do anything. I added a panic inside the #[cfg(feature = "bios")] block inside run_test_kernel_internal and it still passes even with the bios feature explicitly enabled. I think this is because features do not get passed on to the test runner crate. I fixed this by adding a feature dependency, but I'm not entirely sure if that is the proper way to do it. The tests take considerably longer now, so I think that's good.

[features]
default = ["bios", "uefi"]
bios = ["dep:mbrman","bootloader_test_runner/bios"]
uefi = ["dep:gpt","bootloader_test_runner/uefi"]
phil-opp commented 10 months ago

Thanks a lot for reporting! Looks I made the mistake to disable the features in https://github.com/rust-osdev/bootloader/pull/351. I needed to remove the features because of a bug in cargo that led to errors at publish time: https://github.com/rust-lang/cargo/issues/12225 . However, I should have enabled these features unconditionally instead of disabling them. I'll prepare a fix!