Share all "Compiles" tests from VTableIndexStubGenerator with ComInterfaceGenerator#82657
Conversation
…rfaceGeneraterCompilesTests2
|
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsAdds 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.
|
…rfaceGeneraterCompilesTests2
…when there are generator diagnostics
jkoritzinsky
left a comment
There was a problem hiding this comment.
LGTM other than a few nits
…erop.SourceGeneration/GeneratedStatements.cs Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
…rfaceGeneraterCompilesTests2
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.