Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic testing infrastructure in NativeAOT (port from dotnet/linker) #70408

Merged
merged 6 commits into from
Jun 10, 2022

Conversation

tlakollo
Copy link
Contributor

@tlakollo tlakollo commented Jun 7, 2022

  • Port the Mono.Linker.Tests* projects from dotnet/linker
  • Add the new projects to .editorconfig so they remain under the dotnet/linker format instead of dotnet/runtime
  • clr.toolstests subset now runs the Mono.Linker.Tests infrastructure
  • Make DisplayNameHelpers a public class so it can be used by the test infrastructure
  • Add a couple of simple test cases (Dataflow and Requires) along with a Repro test, just like the repro project the repro test serves prototyping purposes
  • Adds ProducedBy.NativeAOT to be able to represent differences between dotnet/linker and NativeAOT (either because of a bug or because NativeAOT correctly produces additional warnings)

Add the new projects to .editorconfig so they remain under the
dotnet/linker format instead of dotnet/runtime
clr.toolstests subset now runs the Mono.Linker.Tests infrastructure
Make DisplayNameHelpers a public class so it can be used by the test
infrastructure
Add couple of simple test cases
@tlakollo tlakollo self-assigned this Jun 7, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

verifiable
Remove deleted folder structures set in TestDatabase
{
private const string DefaultSystemModule = "System.Private.CoreLib";

public void Trim (ILCompilerOptions options, ILogWriter logWriter)
Copy link
Member

Choose a reason for hiding this comment

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

@MichalStrehovsky could you please review this method? It's basically the main part of this change - this runs enough of the ILScanner to get diagnostics.

The rest of this change is mostly making stuff work in XUnit and test adaptations.

Copy link
Member

@MichalStrehovsky MichalStrehovsky Jun 9, 2022

Choose a reason for hiding this comment

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

Looks good to me.

We could potentially simplify things here:

  • I don't think OS/arch matters at all - we could just say we're compiling for x64 Windows and be done with it - if we keep the logic to detect it, it will need fixes whenever a new OS/arch is adde)
  • The list of InitAssemblies probably doesn't matter and we could skip that. JanK is deleting various System.Private assemblies so having this list just means more things to fix up.

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

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

Looks good.

{
private const string DefaultSystemModule = "System.Private.CoreLib";

public void Trim (ILCompilerOptions options, ILogWriter logWriter)
Copy link
Member

@MichalStrehovsky MichalStrehovsky Jun 9, 2022

Choose a reason for hiding this comment

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

Looks good to me.

We could potentially simplify things here:

  • I don't think OS/arch matters at all - we could just say we're compiling for x64 Windows and be done with it - if we keep the logic to detect it, it will need fixes whenever a new OS/arch is adde)
  • The list of InitAssemblies probably doesn't matter and we could skip that. JanK is deleting various System.Private assemblies so having this list just means more things to fix up.

@tlakollo
Copy link
Contributor Author

tlakollo commented Jun 9, 2022

/azp run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@tlakollo tlakollo merged commit ed1595e into dotnet:main Jun 10, 2022
@tlakollo tlakollo deleted the AddTestInfrastructureToNativeAOT branch June 10, 2022 00:07
@ghost ghost locked as resolved and limited conversation to collaborators Jul 10, 2022
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