Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Add tests for dependency graph - #4285

Merged
MichalStrehovsky merged 7 commits into
dotnet:masterfrom
MichalStrehovsky:dependencyAnalysisTests
Aug 14, 2017
Merged

MichalStrehovsky merged 7 commits into
dotnet:masterfrom
MichalStrehovsky:dependencyAnalysisTests

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

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 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.).
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

(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.)

@MichalStrehovsky MichalStrehovsky changed the title [WIP] Add tests for dependency graph Add tests for dependency graph Aug 9, 2017
<PackageReference Include="Microsoft.DiaSymReader">
<Version>1.0.8</Version>
</PackageReference>
<SupplementalTestData Include="..\..\..\packages\microsoft.diasymreader\1.0.8\lib\netstandard1.1\Microsoft.DiaSymReader.dll" />

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fine with me. Comment maybe useful.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@nattress PTAL

@MichalStrehovsky
MichalStrehovsky merged commit 7ad2dbc into dotnet:master Aug 14, 2017
@MichalStrehovsky
MichalStrehovsky deleted the dependencyAnalysisTests branch August 14, 2017 17:45
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