From fbce67218f79a64b8fb46e6b898dc62987bd2a02 Mon Sep 17 00:00:00 2001 From: Mike Voorhees Date: Mon, 5 Jun 2017 15:39:13 -0400 Subject: Make arg builder more extensible --- linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs | 14 ++++++++++++++ linker/Tests/TestCasesRunner/TestRunner.cs | 15 ++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'linker') diff --git a/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs b/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs index 09c728e03..4c2a4e5a5 100644 --- a/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs +++ b/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs @@ -50,5 +50,19 @@ namespace Mono.Linker.Tests.TestCasesRunner { { _arguments.Add (arg); } + + public virtual void ProcessOptions (TestCaseLinkerOptions options) + { + AddCoreLink (options.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 (options.IncludeBlacklistStep)) + IncludeBlacklist (options.IncludeBlacklistStep); + + // Internationalization assemblies pollute our test case results as well so disable them + if (!string.IsNullOrEmpty (options.Il8n)) + AddIl8n (options.Il8n); + } } } \ No newline at end of file diff --git a/linker/Tests/TestCasesRunner/TestRunner.cs b/linker/Tests/TestCasesRunner/TestRunner.cs index 24b766c8b..848ee27b6 100644 --- a/linker/Tests/TestCasesRunner/TestRunner.cs +++ b/linker/Tests/TestCasesRunner/TestRunner.cs @@ -68,20 +68,17 @@ namespace Mono.Linker.Tests.TestCasesRunner { foreach (var extraSearchDir in metadataProvider.GetExtraLinkerSearchDirectories ()) builder.AddSearchDirectory (extraSearchDir); - builder.AddCoreLink (caseDefinedOptions.CoreLink); + builder.ProcessOptions (caseDefinedOptions); - // 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); + AddAdditionalLinkOptions (builder, metadataProvider); linker.Link (builder.ToArgs ()); return new LinkedTestCaseResult (testCase, compilationResult.InputAssemblyPath, sandbox.OutputDirectory.Combine (compilationResult.InputAssemblyPath.FileName), compilationResult.ExpectationsAssemblyPath); } + + protected virtual void AddAdditionalLinkOptions (LinkerArgumentBuilder builder, TestCaseMetadaProvider metadataProvider) + { + } } } \ No newline at end of file -- cgit v1.2.3