-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Start sharing code between ILLink/ILCompiler test infra #91284
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b2c2def
Rename Mono.Linker.Tests to ILCompiler.Tests
sbomer 5cad271
Fix cecil reference
sbomer a215b29
Define empty shared project items
sbomer 8f3eba6
Start sharing code between ILLink/ILCompiler test infra
sbomer 965f3bc
Fix additional defines
sbomer e62e84c
Address feedback
sbomer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions
55
src/coreclr/tools/aot/ILCompiler.Tests/TestCasesRunner/TestRunner.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Threading.Tasks; | ||
| using Mono.Cecil; | ||
| using Mono.Linker.Tests.Extensions; | ||
| using Mono.Linker.Tests.TestCases; | ||
| using Xunit.Sdk; | ||
|
|
||
| namespace Mono.Linker.Tests.TestCasesRunner | ||
| { | ||
| public partial class TestRunner | ||
| { | ||
| partial void IgnoreTest (string reason) | ||
| { | ||
| throw new IgnoreTestException (reason); | ||
| } | ||
|
|
||
| static IEnumerable<string> additionalDefines = new string[] { "NATIVEAOT" }; | ||
| private partial IEnumerable<string>? GetAdditionalDefines () => additionalDefines; | ||
|
|
||
| private static T GetResultOfTaskThatMakesAssertions<T> (Task<T> task) | ||
| { | ||
| try { | ||
| return task.Result; | ||
| } catch (AggregateException e) { | ||
| if (e.InnerException != null) { | ||
| if (e.InnerException is XunitException) | ||
| throw e.InnerException; | ||
| } | ||
|
|
||
| throw; | ||
| } | ||
| } | ||
|
|
||
| protected partial TrimmingCustomizations? CustomizeLinker (TrimmingDriver linker, TestCaseMetadataProvider metadataProvider) | ||
| => null; | ||
|
|
||
| static partial void AddOutputDirectory (TestCaseSandbox sandbox, ManagedCompilationResult compilationResult, TrimmingArgumentBuilder builder) | ||
| { | ||
| builder.AddOutputDirectory (sandbox.OutputDirectory.Combine (compilationResult.InputAssemblyPath.FileNameWithoutExtension + ".obj")); | ||
| } | ||
|
|
||
| static partial void AddInputReference (NPath inputReference, TrimmingArgumentBuilder builder) | ||
| { | ||
| // It's important to add all assemblies as "link" assemblies since the default configuration | ||
| // is to run the compiler in multi-file mode which will not process anything which is just in the reference set. | ||
| builder.AddLinkAssembly (inputReference); | ||
| builder.AddReference (inputReference); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
src/coreclr/tools/aot/ILCompiler.Tests/TrimmingCustomizations.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| using System; | ||
|
|
||
| namespace Mono.Linker.Tests.TestCasesRunner | ||
| { | ||
| public class TrimmingCustomizations | ||
| { | ||
| } | ||
| } |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
src/tools/illink/test/Mono.Linker.Tests.Shared/Mono.Linker.Tests.Shared.projitems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <Project> | ||
|
sbomer marked this conversation as resolved.
|
||
| <ItemGroup> | ||
| <Compile Include="$(MSBuildThisFileDirectory)/**/*.cs" /> | ||
| </ItemGroup> | ||
| </Project> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.