diff options
author | Michael Voorhees <michaelv@unity3d.com> | 2019-06-20 21:34:47 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2019-06-21 14:53:10 +0300 |
commit | e89a36c886c124221abbc3b7bd4da45529576598 (patch) | |
tree | 6bf65fc23d637012686e888ab6a573eb3091c306 /test/Mono.Linker.Tests | |
parent | 7e9b34f7d3847e40dfa0edcc4952b99a8614ae85 (diff) |
Fix mvid tests not respecting derived classes ability to customize setup
Diffstat (limited to 'test/Mono.Linker.Tests')
-rw-r--r-- | test/Mono.Linker.Tests/TestCases/IndividualTests.cs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/test/Mono.Linker.Tests/TestCases/IndividualTests.cs b/test/Mono.Linker.Tests/TestCases/IndividualTests.cs index 2badf7322..0a13697e0 100644 --- a/test/Mono.Linker.Tests/TestCases/IndividualTests.cs +++ b/test/Mono.Linker.Tests/TestCases/IndividualTests.cs @@ -86,8 +86,7 @@ namespace Mono.Linker.Tests.TestCases public void DeterministicMvidWorks() { var testCase = CreateIndividualCase (typeof (DeterministicMvidWorks)); - var runner = new TestRunner (new ObjectFactory ()); - var result = runner.Run (testCase); + var result = Run (testCase, out TestRunner runner); var originalMvid = GetMvid (result.InputAssemblyPath); var firstOutputMvid = GetMvid (result.OutputAssemblyPath); @@ -105,8 +104,7 @@ namespace Mono.Linker.Tests.TestCases public void NewMvidWorks () { var testCase = CreateIndividualCase (typeof (NewMvidWorks)); - var runner = new TestRunner (new ObjectFactory ()); - var result = runner.Run (testCase); + var result = Run (testCase, out TestRunner runner); var originalMvid = GetMvid (result.InputAssemblyPath); var firstOutputMvid = GetMvid (result.OutputAssemblyPath); @@ -123,8 +121,7 @@ namespace Mono.Linker.Tests.TestCases public void RetainMvidWorks () { var testCase = CreateIndividualCase (typeof (RetainMvid)); - var runner = new TestRunner (new ObjectFactory ()); - var result = runner.Run (testCase); + var result = Run (testCase, out TestRunner runner); var originalMvid = GetMvid (result.InputAssemblyPath); var firstOutputMvid = GetMvid (result.OutputAssemblyPath); @@ -141,8 +138,7 @@ namespace Mono.Linker.Tests.TestCases public void DefaultMvidBehavior () { var testCase = CreateIndividualCase (typeof (NewMvidWorks)); - var runner = new TestRunner (new ObjectFactory ()); - var result = runner.Run (testCase); + var result = Run (testCase, out TestRunner runner); var originalMvid = GetMvid (result.InputAssemblyPath); var firstOutputMvid = GetMvid (result.OutputAssemblyPath); @@ -168,9 +164,15 @@ namespace Mono.Linker.Tests.TestCases return TestDatabase.CreateCollector ().CreateIndividualCase (testCaseType); } - protected virtual LinkedTestCaseResult Run (TestCase testCase) + protected LinkedTestCaseResult Run (TestCase testCase) { - var runner = new TestRunner (new ObjectFactory ()); + TestRunner runner; + return Run (testCase, out runner); + } + + protected virtual LinkedTestCaseResult Run (TestCase testCase, out TestRunner runner) + { + runner = new TestRunner (new ObjectFactory ()); return runner.Run (testCase); } } |