Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Voorhees <michaelv@unity3d.com>2017-05-10 21:45:57 +0300
committerMarek Safar <marek.safar@gmail.com>2017-05-16 14:58:33 +0300
commit6f93b07e7b8a8d24a09464e377a12065572237ad (patch)
tree7aad221cb29ae66803579d2c3ce760fa30dcce6d /linker/Tests/TestCasesRunner/TestRunner.cs
parent7785fe94cb5b69acd7ce4a0a68231521528a44f8 (diff)
Make assembly and module attribute marking slightly less conservative.
Currently we mark everything. With this change we will not mark assembly and module attributes when their defining module has not been marked after processing all types. This fixes the test ReferencesAreRemovedWhenAllUsagesAreRemoved when ran against the .NET Framework. When this test was ran against the .NET Framework, System.dll was being kept around because of the assembly attribute BitmapSuffixInSatelliteAssemblyAttribute, which is itself defined in System.dll. Add a command line option to disable the blacklist step Fixed bug with ResultChecker treating [RemovedAssembly] the same as [KeptAssembly] For the test cases, disable options that tend to pollute the linked output with a bunch of preservations that are not needed for our very narrow test cases I did not write a unit test for this case because (a) it would be tricky to do at the moment and (b) we are overly conservative with attributes as a whole and attribute linking need to be reviewed. When that happens, we can pin down the exact behavior we want. The goal of this PR is to get ReferencesAreRemovedWhenAllUsagesAreRemoved passing. Add Il8n and Blacklist option attributes. Only disable these things during the test that needs to
Diffstat (limited to 'linker/Tests/TestCasesRunner/TestRunner.cs')
-rw-r--r--linker/Tests/TestCasesRunner/TestRunner.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/linker/Tests/TestCasesRunner/TestRunner.cs b/linker/Tests/TestCasesRunner/TestRunner.cs
index 0763ca142..b43fda635 100644
--- a/linker/Tests/TestCasesRunner/TestRunner.cs
+++ b/linker/Tests/TestCasesRunner/TestRunner.cs
@@ -70,6 +70,15 @@ namespace Mono.Linker.Tests.TestCasesRunner {
builder.AddCoreLink (caseDefinedOptions.CoreLink);
+ // Running the blacklist step causes a ton of stuff to be preserved. That's good for normal use cases, but for
+ // our test cases that pollutes the results
+ if (!string.IsNullOrEmpty (caseDefinedOptions.IncludeBlacklistStep))
+ builder.IncludeBlacklist (caseDefinedOptions.IncludeBlacklistStep);
+
+ // Internationalization assemblies pollute our test case results as well so disable them
+ if (!string.IsNullOrEmpty (caseDefinedOptions.Il8n))
+ builder.AddIl8n (caseDefinedOptions.Il8n);
+
linker.Link (builder.ToArgs ());
return new LinkedTestCaseResult (testCase, compilationResult.InputAssemblyPath, sandbox.OutputDirectory.Combine (compilationResult.InputAssemblyPath.FileName), compilationResult.ExpectationsAssemblyPath);