Skip to content

Commit 15cefaf

Browse files
authored
Fix test component re-build reliability (#2303)
1 parent be72085 commit 15cefaf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

crates/tests/component/build.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ fn main() -> std::io::Result<()> {
66
let metadata_dir = format!("{}\\System32\\WinMetadata", env!("windir"));
77
std::fs::create_dir_all(".windows/winmd")?;
88

9-
Command::new("midlrt.exe").arg("/winrt").arg("/nomidl").arg("/h").arg("nul").arg("/metadata_dir").arg(&metadata_dir).arg("/reference").arg(format!("{metadata_dir}\\Windows.Foundation.winmd")).arg("/winmd").arg(".windows/winmd/component.winmd").arg("src/component.idl").status()?;
9+
let mut command = Command::new("midlrt.exe");
10+
command.arg("/winrt").arg("/nomidl").arg("/h").arg("nul").arg("/metadata_dir").arg(&metadata_dir).arg("/reference").arg(format!("{metadata_dir}\\Windows.Foundation.winmd")).arg("/winmd").arg(".windows/winmd/component.winmd").arg("src/component.idl");
11+
12+
if !command.status()?.success() {
13+
panic!();
14+
}
1015

1116
let files = metadata::reader::File::with_default(&[".windows/winmd/component.winmd"])?;
1217
write("src/bindings.rs", bindgen::component("test_component", &files))?;

0 commit comments

Comments
 (0)