Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for composable type authoring support #3259

Merged
merged 7 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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