Skip to content

Commit

Permalink
Add test for composable type authoring support (#3259)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Sep 6, 2024
1 parent f3c2576 commit c12340b
Show file tree
Hide file tree
Showing 13 changed files with 1,096 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ jobs:
run: cargo clippy -p test_component
- name: Clippy test_component_client
run: cargo clippy -p test_component_client
- name: Clippy test_composable
run: cargo clippy -p test_composable
- name: Clippy test_composable_client
run: cargo clippy -p test_composable_client
- name: Clippy test_const_fields
run: cargo clippy -p test_const_fields
- name: Clippy test_const_params
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ jobs:
run: cargo test -p test_component --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_component_client
run: cargo test -p test_component_client --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_composable
run: cargo test -p test_composable --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_composable_client
run: cargo test -p test_composable_client --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_const_fields
run: cargo test -p test_const_fields --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_const_params
Expand Down Expand Up @@ -251,12 +255,12 @@ jobs:
run: cargo test -p test_reference_float --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_registry
run: cargo test -p test_registry --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Clean
run: cargo clean
- name: Test test_registry_default
run: cargo test -p test_registry_default --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_reserved
run: cargo test -p test_reserved --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Clean
run: cargo clean
- name: Test test_resources
run: cargo test -p test_resources --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_result
Expand Down
24 changes: 24 additions & 0 deletions crates/tests/winrt/composable/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "test_composable"
version = "0.0.0"
edition = "2021"
publish = false

[lib]
crate-type = ["cdylib"]
doc = false
doctest = false

[build-dependencies.windows-bindgen]
workspace = true

[dependencies.windows-core]
workspace = true

[dependencies.windows]
workspace = true
features = [
"implement",
"Foundation",
"Win32_System_WinRT",
]
33 changes: 33 additions & 0 deletions crates/tests/winrt/composable/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
fn main() {
let mut command = std::process::Command::new("midlrt.exe");
command.args([
"/winrt",
"/nomidl",
"/h",
"nul",
"/metadata_dir",
"../../../libs/bindgen/default",
"/reference",
"../../../libs/bindgen/default/Windows.winmd",
"/winmd",
"metadata.winmd",
"src/metadata.idl",
]);

if !command.status().unwrap().success() {
panic!("Failed to run midlrt");
}

windows_bindgen::bindgen([
"--in",
"metadata.winmd",
"--out",
"src/bindings.rs",
"--filter",
"test_composable",
"--config",
"implement",
"no-bindgen-comment",
])
.unwrap();
}
Loading

0 comments on commit c12340b

Please sign in to comment.