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:
authorMarek Safar <marek.safar@gmail.com>2020-03-26 12:30:23 +0300
committerGitHub <noreply@github.com>2020-03-26 12:30:23 +0300
commit78768ce44c00b352d1ca11124e0b362516fa0266 (patch)
tree72a521ecaded932fc0756957c4f82c1164264cff /test/Mono.Linker.Tests
parent8f766ba708a50b789496ce534b7a326a7aae6f0e (diff)
Add sealer opt-in optimization (#1011)
* Add sealer opt-in optimization * Review feedback * Add local cache for IsSubclassed check * Generate verifiable metadata * Move nested check before interface shortcut
Diffstat (limited to 'test/Mono.Linker.Tests')
-rw-r--r--test/Mono.Linker.Tests/TestCases/TestDatabase.cs5
-rw-r--r--test/Mono.Linker.Tests/TestCases/TestSuites.cs6
-rw-r--r--test/Mono.Linker.Tests/Tests/CodeOptimizationsSettingsTests.cs11
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