Add tests for dependency graph - #4285
Conversation
This adds a unit test for `ILCompiler.Compiler` so that we can no longer use this as an excuse not to write unit tests for this assembly. The first test is a generalized framework to write tests for dependency graph. The test runs ILScanner on a method from the test assembly, and validates various invariants that the method declares. This will let us e.g. write targeted unit tests that check that the various size on disk features within the compiler do the right thing (e.g. make sure we don't unnecessarily expand variant interfaces, GVMs, etc.).
|
(This is marked as WIP because I need to fight a battle with NuGet/MSBuild: they don't bother with copying dependent NuGet assemblies to the output and we're failing to find the DiaSymReader assembly when initializing the type system.) |
| <PackageReference Include="Microsoft.DiaSymReader"> | ||
| <Version>1.0.8</Version> | ||
| </PackageReference> | ||
| <SupplementalTestData Include="..\..\..\packages\microsoft.diasymreader\1.0.8\lib\netstandard1.1\Microsoft.DiaSymReader.dll" /> |
There was a problem hiding this comment.
@ericstj Can you think of anything less hacky for this (or know someone who would)? This should be a standard xunit BuildTools-powered unit test that depends on a NuGet package, but the build scripts don't bother with copying the dependency and I couldn't find a way to make them care.
There was a problem hiding this comment.
@jkotas Do you mind if we check this in like this and get rid of the workaround once we get rid of the buildtools plague in the repo?
There was a problem hiding this comment.
Fine with me. Comment maybe useful.
|
@nattress PTAL |
This adds a unit test for
ILCompiler.Compilerso that we can no longeruse this as an excuse not to write unit tests for this assembly.
The first test is a generalized framework to write tests for dependency
graph. The test runs ILScanner on a method from the test assembly, and
validates various invariants that the method declares. This will let us
e.g. write targeted unit tests that check that the various size on disk
features within the compiler do the right thing (e.g. make sure we don't
unnecessarily expand variant interfaces, GVMs, etc.).