test_boot_config.rs 744 B

123456789101112131415161718
  1. use dadk_config::{self, boot::BootConfigFile};
  2. use test_base::{
  3. dadk_config::DadkConfigTestContext,
  4. test_context::{self as test_context, test_context},
  5. };
  6. const BOOT_CONFIG_FILE_NAME: &str = "config/boot.toml";
  7. /// 测试加载模板目录中的 boot.toml 文件,验证它能被加载成功.
  8. #[test_context(DadkConfigTestContext)]
  9. #[test]
  10. fn test_load_boot_config_template(ctx: &DadkConfigTestContext) {
  11. let boot_config_path = ctx.templates_dir().join(BOOT_CONFIG_FILE_NAME);
  12. assert_eq!(boot_config_path.exists(), true);
  13. assert_eq!(boot_config_path.is_file(), true);
  14. let _manifest = BootConfigFile::load(&boot_config_path).expect("Failed to load boot config");
  15. // TODO 校验 manifest 中的字段是否齐全
  16. }