Skip to content

Share all "Compiles" tests from VTableIndexStubGenerator with ComInterfaceGenerator#82657

Merged
jtschuster merged 13 commits into
dotnet:mainfrom
jtschuster:comInterfaceGeneraterCompilesTests2
Mar 6, 2023
Merged

Share all "Compiles" tests from VTableIndexStubGenerator with ComInterfaceGenerator#82657
jtschuster merged 13 commits into
dotnet:mainfrom
jtschuster:comInterfaceGeneraterCompilesTests2

Conversation

@jtschuster
Copy link
Copy Markdown
Member

@jtschuster jtschuster commented Feb 25, 2023

Adds all the "Compiled" tests for VTableStubGenerator to ComInterfaceGenerator tests.

Makes ICustomMarshallingSignatureTestProvider methods instance instead of static, requiring a TSignatureTestProvider to be passed to the contructor of Custom[Struct|Collection]MarshallingCodeSnippets. This lets us have different attributes in the snippets based on which generator the snippet is for (e.g. VTableIndexAttribute will be present for VTableStubGenerator, but not for ComInterfaceGenerator).

All tests pass in the ComInterfaceGenerator now, though we don't check for compiler errors if the generator produces warnings.

Includes the changes from #82740.

@ghost
Copy link
Copy Markdown

ghost commented Feb 27, 2023

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

Adds all the "Compiled" tests for VTableStubGenerator to ComInterfaceGenerator tests.

Makes ICustomMarshallingSignatureTestProvider methods instance instead of static, requiring a TSignatureTestProvider to be passed to the contructor of Custom[Struct|Collection]MarshallingCodeSnippets. This lets us have different attributes in the snippets based on which generator the snippet is for (e.g. VTableIndexAttribute will be present for VTableStubGenerator, but not for ComInterfaceGenerator).

The tests that work with ComInterfaceGenerator are in the Shared...() snippets. The others are in ValidateComInterfaceSnippetsFailing, which passes if the testcase would fail in ValidateComInterfaceSnippets. This makes it easier to tell which tests were fixed by a change.

Author: jtschuster
Assignees: jtschuster
Labels:

area-System.Runtime.InteropServices

Milestone: -

Copy link
Copy Markdown
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than a few nits

jtschuster and others added 2 commits March 2, 2023 15:28
…erop.SourceGeneration/GeneratedStatements.cs

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
@jtschuster jtschuster merged commit 598bc65 into dotnet:main Mar 6, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants