diff options
Diffstat (limited to 'test/Mono.Linker.Tests')
-rw-r--r-- | test/Mono.Linker.Tests/TestCases/TestDatabase.cs | 5 | ||||
-rw-r--r-- | test/Mono.Linker.Tests/TestCases/TestSuites.cs | 6 | ||||
-rw-r--r-- | test/Mono.Linker.Tests/Tests/CodeOptimizationsSettingsTests.cs | 11 |
3 files changed, 22 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests/TestCases/TestDatabase.cs b/test/Mono.Linker.Tests/TestCases/TestDatabase.cs index fe40ae4d5..5e603ba19 100644 --- a/test/Mono.Linker.Tests/TestCases/TestDatabase.cs +++ b/test/Mono.Linker.Tests/TestCases/TestDatabase.cs @@ -147,6 +147,11 @@ namespace Mono.Linker.Tests.TestCases return NUnitCasesBySuiteName ("UnreachableBlock"); } + public static IEnumerable<TestCaseData> SealerTests () + { + return NUnitCasesBySuiteName ("Sealer"); + } + public static IEnumerable<TestCaseData> SubstitutionsTests () { return NUnitCasesBySuiteName ("Substitutions"); diff --git a/test/Mono.Linker.Tests/TestCases/TestSuites.cs b/test/Mono.Linker.Tests/TestCases/TestSuites.cs index 2fda3c3e9..60f2ff9ed 100644 --- a/test/Mono.Linker.Tests/TestCases/TestSuites.cs +++ b/test/Mono.Linker.Tests/TestCases/TestSuites.cs @@ -187,6 +187,12 @@ namespace Mono.Linker.Tests.TestCases Run (testCase); } + [TestCaseSource (typeof (TestDatabase), nameof (TestDatabase.SealerTests))] + public void SealerTests (TestCase testCase) + { + Run (testCase); + } + protected virtual void Run (TestCase testCase) { var runner = new TestRunner (new ObjectFactory ()); diff --git a/test/Mono.Linker.Tests/Tests/CodeOptimizationsSettingsTests.cs b/test/Mono.Linker.Tests/Tests/CodeOptimizationsSettingsTests.cs index e7b8ff2f6..a05fb5393 100644 --- a/test/Mono.Linker.Tests/Tests/CodeOptimizationsSettingsTests.cs +++ b/test/Mono.Linker.Tests/Tests/CodeOptimizationsSettingsTests.cs @@ -40,5 +40,16 @@ namespace Mono.Linker.Tests Assert.False (cos.IsEnabled (CodeOptimizations.ClearInitLocals, "any")); Assert.That (cos.IsEnabled (CodeOptimizations.BeforeFieldInit, "testasm.dll")); } + + [Test] + public void OnlyOneOptIsDisabled () + { + CodeOptimizationsSettings cos = new CodeOptimizationsSettings (CodeOptimizations.OverrideRemoval); + cos.Disable (CodeOptimizations.BeforeFieldInit, "testasm.dll"); + + Assert.False (cos.IsEnabled (CodeOptimizations.BeforeFieldInit, "testasm.dll")); + Assert.False (cos.IsEnabled (CodeOptimizations.Sealer, "testasm.dll")); + Assert.False (cos.IsEnabled (CodeOptimizations.UnreachableBodies, "testasm.dll")); + } } }
\ No newline at end of file |