Fix missing changes in from ProducedBy enum change (#82575)
authorTlakaelel Axayakatl Ceja <tlakaelel.ceja@microsoft.com>
Fri, 24 Feb 2023 09:01:57 +0000 (01:01 -0800)
committerGitHub <noreply@github.com>
Fri, 24 Feb 2023 09:01:57 +0000 (18:01 +0900)
src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs
src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs
src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs
src/tools/illink/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyMethod.cs

index bfc580234b2ef65a55613f38431d90fe2392d15c..b2ef85209147941cdb1ab23658ddc3359c8768bd 100644 (file)
@@ -175,8 +175,8 @@ namespace Mono.Linker.Tests.TestCasesRunner
                                if (typeDef.IsDelegate) {
                                        // AOT's handling of delegates is very different from the IL/metadata picture
                                        // So to simplify this, we're going to automatically "mark" all of the delegate's methods
-                                       foreach (MethodDesc m in typeDef.GetMethods()) {
-                                               if (ShouldIncludeEntityByDisplayName(m)) {
+                                       foreach (MethodDesc m in typeDef.GetMethods ()) {
+                                               if (ShouldIncludeEntityByDisplayName (m)) {
                                                        AddMember (m);
                                                }
                                        }
@@ -1195,7 +1195,7 @@ namespace Mono.Linker.Tests.TestCasesRunner
                                }
 
                                object? keptBy = ca.GetPropertyValue (nameof (KeptAttribute.By));
-                               return keptBy is null ? true : ((ProducedBy) keptBy).HasFlag (ProducedBy.NativeAot);
+                               return keptBy is null ? true : ((Tool) keptBy).HasFlag (Tool.NativeAot);
                        });
                }
 
@@ -1212,7 +1212,7 @@ namespace Mono.Linker.Tests.TestCasesRunner
                                }
 
                                object? keptBy = ca.GetPropertyValue (nameof (KeptAttribute.By));
-                               return keptBy is null ? true : ((ProducedBy) keptBy).HasFlag (ProducedBy.NativeAot);
+                               return keptBy is null ? true : ((Tool) keptBy).HasFlag (Tool.NativeAot);
                        });
                }
 
index f7db7fcf288cd73f7500d6b1a465fd5435724b88..4d694b7ae0061c7326b740eb890ebac3602f6e79 100644 (file)
@@ -168,7 +168,7 @@ namespace Mono.Linker.Tests.TestCasesRunner
                private static bool IsProducedByNativeAOT (CustomAttribute attr)
                {
                        var producedBy = attr.GetPropertyValue ("ProducedBy");
-                       return producedBy is null ? true : ((ProducedBy) producedBy).HasFlag (ProducedBy.NativeAot);
+                       return producedBy is null ? true : ((Tool) producedBy).HasFlag (Tool.NativeAot);
                }
 
                private static IEnumerable<ICustomAttributeProvider> GetAttributeProviders (AssemblyDefinition assembly)
@@ -405,7 +405,7 @@ namespace Mono.Linker.Tests.TestCasesRunner
 
                                var actualOriginToken = new AssemblyQualifiedToken (origin.Value.MemberDefinition);
                                var expectedOriginToken = new AssemblyQualifiedToken (expectedOriginMember);
-                               if (actualOriginToken.Equals(expectedOriginToken))
+                               if (actualOriginToken.Equals (expectedOriginToken))
                                        return true;
 
                                var actualMember = origin.Value.MemberDefinition;
index b1246cf12f2a721966776fb2f9f393773c06bd09..e97a51a5c2c7378543fb8f4bc9fbd8cc9c762605 100644 (file)
@@ -29,13 +29,13 @@ namespace Mono.Linker.Tests.TestCasesRunner
                private static bool IsIgnoredByNativeAOT (CustomAttribute attr)
                {
                        var ignoredBy = attr.GetPropertyValue ("IgnoredBy");
-                       return ignoredBy is null ? true : ((ProducedBy) ignoredBy).HasFlag (ProducedBy.NativeAot);
+                       return ignoredBy is null ? true : ((Tool) ignoredBy).HasFlag (Tool.NativeAot);
                }
 
-               public virtual bool IsIgnored ([NotNullWhen(true)] out string? reason)
+               public virtual bool IsIgnored ([NotNullWhen (true)] out string? reason)
                {
                        var ignoreAttribute = _testCaseTypeDefinition.CustomAttributes.FirstOrDefault (attr => attr.AttributeType.Name == nameof (IgnoreTestCaseAttribute));
-                       if (ignoreAttribute != null && IsIgnoredByNativeAOT(ignoreAttribute)) {
+                       if (ignoreAttribute != null && IsIgnoredByNativeAOT (ignoreAttribute)) {
                                if (ignoreAttribute.ConstructorArguments.Count == 1) {
                                        reason = (string) ignoreAttribute.ConstructorArguments.First ().Value;
                                        return true;
index 5a935bd55b980e898c10d80c431fd44b2e5150b8..75db763733993ec1ae083d5a9856339ff159a2ad 100644 (file)
@@ -203,7 +203,7 @@ namespace Mono.Linker.Tests.Cases.DynamicDependencies
                [KeptMember (".ctor()")]
                private abstract class AbstractMethods
                {
-                       [Kept (By = ProducedBy.Trimmer)] // NativeAOT test infra doesn't check reflection-only methods (without entry point) yet
+                       [Kept (By = Tool.Trimmer)] // NativeAOT test infra doesn't check reflection-only methods (without entry point) yet
                        [DynamicDependency (nameof (TargetMethod))]
                        public abstract void SourceAbstractViaReflection ();