Add WinRT regression test harness (portable golden net) - #66
Open
Gordon Lam (yeelam-gordon) wants to merge 8 commits into
Open
Add WinRT regression test harness (portable golden net)#66Gordon Lam (yeelam-gordon) wants to merge 8 commits into
Gordon Lam (yeelam-gordon) wants to merge 8 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot review (PR #3): projected_values_equal returned after the FIRST shared attribute (name/value/path) matched, so an object exposing more than one of them (e.g. both .name and .value) could be treated as equal when only the first matches, weakening the regression protocol checks. Compare every shared attribute and return False if any differ; keep the scalar-equality fallback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nown kinds Copilot review: the E2E spec schema includes instantiate.kind 'constructor' (py_runner already handles it), but ts_runner only handled 'activate'/'static_factory', leaving obj null and proceeding for 'constructor' or any unexpected kind — which could report a pass with no object. Add the 'constructor' branch (new cls(...args), mirroring py_runner) and throw on unknown kinds. (The current constructor spec is py-only, so no ts behavior changes today; this is defensive.) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…D_MODE in init Copilot review (PR #3): - winrt_regression.rs uses WinRT/Win32 APIs (RoInitialize etc.) and won't compile on non-Windows; add #![cfg(windows)] so cargo test stays usable off-Windows. - init_winrt ignored ALL RoInitialize failures despite the comment saying only the already-initialized case is benign. Now it accepts only RPC_E_CHANGED_MODE (already initialized in a different apartment; S_FALSE is already Ok) and panics on any other HRESULT so a genuine init failure is diagnosable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…aw literal Copilot review (PR #3): the golden-behavior harness asserted against a raw 0x80028CA0 HRESULT literal. Name it TYPE_E_TYPEMISMATCH locally (GetString on a non-string IPropertyValue) for readability/maintainability.
The earlier ts_runner 'constructor' handling compared instKind against a literal not
in the Instantiate.kind union ('activate' | 'static_factory' | 'none'), which a
type-checked (tsc) run rejects as TS2367 (no overlap). Extend the union to include
'constructor'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a portable WinRT regression test — one self‑contained integration test (
crates/dynwinrt/tests/winrt_regression.rs) that uses only dynwinrt's public API and asserts ~43 golden facts about real WinRT behavior. It locks current behavior so future engine/codegen changes can't silently regress it. Independent of the Win32/COM work.Motivation
dynwinrt is a dynamic FFI + codegen engine: it marshals arbitrary WinRT calls through libffi driven by
.winmdmetadata. Regressions there are easy to introduce and hard to notice by eye. This net runs in CI (cargo test -p dynwinrt) and is deliberately public‑API‑only, so it stays stable across internal refactors while still exercising the full activate → dynamic‑invoke → marshal‑back path against real Windows APIs.What it covers
Windows.Foundation.Uri— dynamically activate and readHost/Domain/Path/SchemeName/AbsoluteUrifor fixed inputs (incl. query/fragment, empty‑path).PropertyValue— scalar create/read round‑trips and type‑mismatch behavior.BasicGeoposition/Geopoint— value‑type struct layout + a dynamic round‑trip through a factory that takes a struct.Sample (shape of an assertion)
Status
Green today: 1 integration test, ~43 assertions, alongside the existing unit suite. Base:
main; independent of the classic‑COM and flat‑Win32 PRs (it is used to prove those don't regress WinRT behavior).