xref: /DADK/dadk-config/tests/test_boot_config.rs (revision c9f71754563759e653d59a110f15298891564be9)
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 
7 const BOOT_CONFIG_FILE_NAME: &str = "config/boot.toml";
8 
9 /// 测试加载模板目录中的 boot.toml 文件,验证它能被加载成功.
10 #[test_context(DadkConfigTestContext)]
11 #[test]
12 fn test_load_boot_config_template(ctx: &DadkConfigTestContext) {
13     let boot_config_path = ctx.templates_dir().join(BOOT_CONFIG_FILE_NAME);
14     assert_eq!(boot_config_path.exists(), true);
15     assert_eq!(boot_config_path.is_file(), true);
16     let _manifest = BootConfigFile::load(&boot_config_path).expect("Failed to load boot config");
17     // TODO 校验 manifest 中的字段是否齐全
18 }
19