From 2458c3fb77541a102314125f9116feaacb4f5569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 26 Mar 2024 07:47:47 +0100 Subject: [PATCH 1/3] Revert "Add back NoWarn (#99995)" This reverts commit 43b55faf1586242c990051c01f8e13e6dfd0813f. --- src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj index 7689ad3fbd277e..bf21e8f49d70eb 100644 --- a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj +++ b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj @@ -3,9 +3,6 @@ true true - - $(NoWarn);IL2050 - true From ecf2d581c6e97d9e5534acae9d9444e2241677c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 26 Mar 2024 07:48:11 +0100 Subject: [PATCH 2/3] Revert "Convert the Remaining Legacy Tests to the Merged Wrapper Model (#98469)" This reverts commit 41c60577db9b2eb89d96c1ead04fb60adca5a4ee. --- src/tests/managed/Compilation/Compilation.cs | 22 +- .../managed/Compilation/Compilation.csproj | 2 +- src/tests/managed/Managed.csproj | 11 - src/tests/nativeaot/CustomMain/CustomMain.cs | 6 +- .../nativeaot/CustomMain/CustomMain.csproj | 2 +- .../GenerateUnmanagedEntryPoints.cs | 8 +- .../GenerateUnmanagedEntryPoints.csproj | 2 +- src/tests/nativeaot/NativeAot.csproj | 23 - .../SmokeTests/ComWrappers/ComWrappers.cs | 6 +- .../SmokeTests/ComWrappers/ComWrappers.csproj | 7 +- .../SmokeTests/Determinism/Determinism.cs | 57 +- .../SmokeTests/Determinism/Determinism.csproj | 5 +- .../SmokeTests/DwarfDump/DwarfDump.csproj | 2 +- .../nativeaot/SmokeTests/DwarfDump/Program.cs | 4 +- .../DynamicGenerics/DynamicGenerics.csproj | 2 +- .../DynamicGenerics/DynamicGenerics.main.cs | 319 ++++---- .../SmokeTests/Exceptions/Exceptions.cs | 4 +- .../SmokeTests/Exceptions/Exceptions.csproj | 3 +- .../FrameworkStrings/Baseline.csproj | 3 +- .../SmokeTests/FrameworkStrings/Program.cs | 130 ++- .../UseSystemResourceKeys.csproj | 2 +- .../SmokeTests/HardwareIntrinsics/Program.cs | 10 +- .../HardwareIntrinsics/X64Avx.csproj | 2 +- .../HardwareIntrinsics/X64Avx2.csproj | 3 +- .../HardwareIntrinsics/X64Avx512.csproj | 3 +- .../HardwareIntrinsics/X64Avx_NoAvx2.csproj | 3 +- .../HardwareIntrinsics/X64Baseline.csproj | 3 +- .../HardwareIntrinsics/X64Sse42.csproj | 3 +- .../SmokeTests/MultiModule/Library.csproj | 1 - .../SmokeTests/MultiModule/MultiModule.csproj | 3 - .../nativeaot/SmokeTests/PInvoke/PInvoke.cs | 12 +- .../SmokeTests/PInvoke/PInvoke.csproj | 4 +- .../Preinitialization/Preinitialization.cs | 6 +- .../Preinitialization.csproj | 2 +- .../SmokeTests/Reflection/Reflection.cs | 12 +- .../SmokeTests/Reflection/Reflection.csproj | 2 +- .../Reflection/Reflection_FromUsage.csproj | 2 +- .../StackTraceMetadata/StackTraceMetadata.cs | 8 +- .../StackTraceMetadata.csproj | 2 +- .../StackTraceMetadata_Stripped.csproj | 2 +- .../SmokeTests/TrimmingBehaviors/Main.cs | 43 +- .../TrimmingBehaviors.csproj | 2 +- .../nativeaot/SmokeTests/UnitTests/Main.cs | 47 +- .../SmokeTests/UnitTests/UnitTests.csproj | 4 +- .../Win32Resources/Win32Resources.cs | 23 +- .../Win32Resources/Win32Resources.csproj | 2 +- .../nativeaot/StartupHook/StartupHook.cs | 9 +- .../nativeaot/StartupHook/StartupHook.csproj | 8 +- src/tests/sizeondisk/Directory.Build.props | 7 + src/tests/sizeondisk/sodbench/SoDBench.cs | 754 ++++++++++++++++++ src/tests/sizeondisk/sodbench/SoDBench.csproj | 11 + .../sodbench/THIRD-PARTY-NOTICES.TXT | 25 + 52 files changed, 1137 insertions(+), 501 deletions(-) delete mode 100644 src/tests/managed/Managed.csproj delete mode 100644 src/tests/nativeaot/NativeAot.csproj create mode 100644 src/tests/sizeondisk/Directory.Build.props create mode 100644 src/tests/sizeondisk/sodbench/SoDBench.cs create mode 100644 src/tests/sizeondisk/sodbench/SoDBench.csproj create mode 100644 src/tests/sizeondisk/sodbench/THIRD-PARTY-NOTICES.TXT diff --git a/src/tests/managed/Compilation/Compilation.cs b/src/tests/managed/Compilation/Compilation.cs index 4852618cea3ed0..0b1e9d2cd9872f 100644 --- a/src/tests/managed/Compilation/Compilation.cs +++ b/src/tests/managed/Compilation/Compilation.cs @@ -8,34 +8,24 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; -using Xunit; -public class Program +class Program { - [Fact] - public static int TestEntryPoint() + static int Main() { Console.WriteLine("Starting the test"); string codeFile = @"HelloWorld.cs"; - var sourceTree = new List() - { - SyntaxFactory.ParseSyntaxTree(File.ReadAllText(codeFile)) - }; - - string mscorlibFile = Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), - "System.Private.CoreLib.dll"); + var sourceTree = new List(){SyntaxFactory.ParseSyntaxTree(File.ReadAllText(codeFile))}; + string mscorlibFile = Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), "System.Private.CoreLib.dll"); Console.WriteLine("Using reference to: {0}", mscorlibFile); - var reference = new List() - { - MetadataReference.CreateFromFile(mscorlibFile) - }; + var reference = new List(){ MetadataReference.CreateFromFile(mscorlibFile)}; var compilation = CSharpCompilation.Create("helloworld", sourceTree, reference); + Console.WriteLine("Test compiled"); var result = compilation.Emit(new FileStream("helloworld.exe", FileMode.Create)); - if (!result.Success) { return -1; diff --git a/src/tests/managed/Compilation/Compilation.csproj b/src/tests/managed/Compilation/Compilation.csproj index ecd42497008239..f6521d8ff2df4b 100644 --- a/src/tests/managed/Compilation/Compilation.csproj +++ b/src/tests/managed/Compilation/Compilation.csproj @@ -1,6 +1,6 @@ - true + Exe true true diff --git a/src/tests/managed/Managed.csproj b/src/tests/managed/Managed.csproj deleted file mode 100644 index 305a3dfa0b613b..00000000000000 --- a/src/tests/managed/Managed.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - false - - - - diff --git a/src/tests/nativeaot/CustomMain/CustomMain.cs b/src/tests/nativeaot/CustomMain/CustomMain.cs index 58981bcc263676..97db548fe54d17 100644 --- a/src/tests/nativeaot/CustomMain/CustomMain.cs +++ b/src/tests/nativeaot/CustomMain/CustomMain.cs @@ -4,9 +4,8 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using Xunit; -public class Program +class Program { // Each of the module initializer, class constructor, and IncrementExitCode // should be executed exactly once, causing this to each 100 by program exit. @@ -33,8 +32,7 @@ static void IncrementExitCode(int amount) int ExitCode; - [Fact] - public static int TestEntryPoint() + static int Main(string[] args) { Console.WriteLine("hello from managed main"); return s_exitCode; diff --git a/src/tests/nativeaot/CustomMain/CustomMain.csproj b/src/tests/nativeaot/CustomMain/CustomMain.csproj index 4746f0a95eef5a..f3787228534828 100644 --- a/src/tests/nativeaot/CustomMain/CustomMain.csproj +++ b/src/tests/nativeaot/CustomMain/CustomMain.csproj @@ -1,8 +1,8 @@ + Exe true lib - true diff --git a/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.cs b/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.cs index c2962fbded73a9..b1251f9fc382a6 100644 --- a/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.cs +++ b/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.cs @@ -4,17 +4,15 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using Xunit; namespace GenerateUnmanagedEntryPoints { - public unsafe class Program + unsafe class Program { [UnmanagedCallersOnly(EntryPoint = "MainAssemblyMethod")] static void MainAssemblyMethod() => Console.WriteLine($"Hello from {nameof(MainAssemblyMethod)}"); - [Fact] - public static int TestEntryPoint() + static int Main() { IntPtr methodAddress = IntPtr.Zero; IntPtr programHandle = IntPtr.Zero; @@ -54,4 +52,4 @@ public static int TestEntryPoint() return 100; } } -} +} \ No newline at end of file diff --git a/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj b/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj index 95a6bfd2fc58ba..a9de558d66da0e 100644 --- a/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj +++ b/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj @@ -1,7 +1,7 @@ + Exe true - true true - - - - - false - - - - diff --git a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs index 782430a94ca85f..c4eb54cd880774 100644 --- a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs +++ b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs @@ -6,17 +6,15 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; -using Xunit; namespace ComWrappersTests { - public class Program + internal class Program { static ComWrappers GlobalComWrappers; [DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(IComInterface))] - [Fact] - public static int TestEntryPoint() + public static int Main() { TestComInteropNullPointers(); TestComInteropRegistrationRequired(); diff --git a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj index bf21e8f49d70eb..1d0e64a4443a5b 100644 --- a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj +++ b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj @@ -1,12 +1,13 @@ + Exe true true - - true - + + $(NoWarn);IL2050 + diff --git a/src/tests/nativeaot/SmokeTests/Determinism/Determinism.cs b/src/tests/nativeaot/SmokeTests/Determinism/Determinism.cs index 5e5fdf63797833..bd2361ddf0e8b5 100644 --- a/src/tests/nativeaot/SmokeTests/Determinism/Determinism.cs +++ b/src/tests/nativeaot/SmokeTests/Determinism/Determinism.cs @@ -3,45 +3,30 @@ using System; using System.IO; -using Xunit; -public class Program -{ - [Fact] - public static int TestEntryPoint() - { - var baseline = File.OpenRead("baseline.object"); - var compare = File.OpenRead("compare.object"); - - Console.WriteLine($"Baseline size: {baseline.Length}"); - Console.WriteLine($"Compare size: {compare.Length}"); +using var baseline = File.OpenRead("baseline.object"); +using var compare = File.OpenRead("compare.object"); - if (baseline.Length != compare.Length) - { - Console.WriteLine("Test Fail: Baseline and Compare have different sizes."); - return 101; - } +Console.WriteLine($"Baseline size: {baseline.Length}"); +Console.WriteLine($"Compare size: {compare.Length}"); - long length = baseline.Length; - for (int i = 0; i < length; i++) - { - if (baseline.ReadByte() != compare.ReadByte()) - { - Console.WriteLine($"Test Fail: Baseline and Compare were different" - + " at byte {i}."); - return 101; - } - } +if (baseline.Length != compare.Length) + throw new Exception("Different sizes"); - // We're not interested in running this, we just want some junk to compile - if (Environment.GetEnvironmentVariable("Never") == "Ever") - { - Delegates.Run(); - Devirtualization.Run(); - Generics.Run(); - Interfaces.Run(); - } +long length = baseline.Length; +for (int i = 0; i < length; i++) +{ + if (baseline.ReadByte() != compare.ReadByte()) + throw new Exception($"Different at byte {i}"); +} - return 100; - } +// We're not interested in running this, we just want some junk to compile +if (Environment.GetEnvironmentVariable("Never") == "Ever") +{ + Delegates.Run(); + Devirtualization.Run(); + Generics.Run(); + Interfaces.Run(); } + +return 100; diff --git a/src/tests/nativeaot/SmokeTests/Determinism/Determinism.csproj b/src/tests/nativeaot/SmokeTests/Determinism/Determinism.csproj index 50e1f1ace30947..d69c92257e2414 100644 --- a/src/tests/nativeaot/SmokeTests/Determinism/Determinism.csproj +++ b/src/tests/nativeaot/SmokeTests/Determinism/Determinism.csproj @@ -1,19 +1,18 @@ + Exe 0 true - true - true - + + Exe 0 - true true diff --git a/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs b/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs index 46130efa7b96bd..f2ce9829bd69b5 100644 --- a/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs +++ b/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs @@ -5,12 +5,10 @@ using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; -using Xunit; public class Program { - [Fact] - public static int TestEntryPoint() + public static int Main(string[] args) { var llvmDwarfDumpPath = Path.Combine( Environment.GetEnvironmentVariable("CORE_ROOT"), diff --git a/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.csproj b/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.csproj index 11dd81b4c86e85..cbaf77702f9c27 100644 --- a/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.csproj +++ b/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.csproj @@ -1,8 +1,8 @@ + Exe 0 true - true true diff --git a/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs b/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs index 8c3ffe4145600e..c1b59061534fcb 100644 --- a/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs +++ b/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs @@ -1,183 +1,166 @@ -using Xunit; - public class EntryPointMain { - [Fact] - public static int TestEntryPoint() + public static int Main(string[] args) { - CoreFXTestLibrary.Internal.TestInfo[] tests = new CoreFXTestLibrary.Internal.TestInfo[] - { - new CoreFXTestLibrary.Internal.TestInfo("My.TestActivatorCreateInstance", () => global::My.TestActivatorCreateInstance(), null), - new CoreFXTestLibrary.Internal.TestInfo("My.TestDefaultCtorInLazyGenerics", () => global::My.TestDefaultCtorInLazyGenerics(), null), - new CoreFXTestLibrary.Internal.TestInfo("Expressions.ExpressionsTesting.TestLdTokenResults", () => global::Expressions.ExpressionsTesting.TestLdTokenResults(), null), - new CoreFXTestLibrary.Internal.TestInfo("Expressions.ExpressionsTesting.TestLdTokenResultsWithStructTypes", () => global::Expressions.ExpressionsTesting.TestLdTokenResultsWithStructTypes(), null), - new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestInstanceMethod", () => global::MakeGenMethod.Test.TestInstanceMethod(), null), - new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestStaticMethod", () => global::MakeGenMethod.Test.TestStaticMethod(), null), - new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestGenericMethodsWithEnumParametersHavingDefaultValues", () => global::MakeGenMethod.Test.TestGenericMethodsWithEnumParametersHavingDefaultValues(), null), - new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestNoDictionaries", () => global::MakeGenMethod.Test.TestNoDictionaries(), null), - new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestGenMethodOnGenType", () => global::MakeGenMethod.Test.TestGenMethodOnGenType(), null), - new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestReverseLookups", () => global::MakeGenMethod.Test.TestReverseLookups(), null), - new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestReverseLookupsWithArrayArg", () => global::MakeGenMethod.Test.TestReverseLookupsWithArrayArg(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestArrays", () => global::ArrayTests.ArrayTests.TestArrays(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestDynamicArrays", () => global::ArrayTests.ArrayTests.TestDynamicArrays(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestMDArrays", () => global::ArrayTests.ArrayTests.TestMDArrays(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestArrayIndexOfNullableStructOfCanon_USG", () => global::ArrayTests.ArrayTests.TestArrayIndexOfNullableStructOfCanon_USG(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestArrayIndexOfNullableStructOfCanon_Canon", () => global::ArrayTests.ArrayTests.TestArrayIndexOfNullableStructOfCanon_Canon(), null), - new CoreFXTestLibrary.Internal.TestInfo("BlockedTypesTests.TestBlockedTypes", () => global::BlockedTypesTests.TestBlockedTypes(), null), - new CoreFXTestLibrary.Internal.TestInfo("ConstraintsTests.TestInvalidInstantiations", () => global::ConstraintsTests.TestInvalidInstantiations(), null), - new CoreFXTestLibrary.Internal.TestInfo("ConstraintsTests.TestSpecialConstraints", () => global::ConstraintsTests.TestSpecialConstraints(), null), - new CoreFXTestLibrary.Internal.TestInfo("ConstraintsTests.TestTypeConstraints", () => global::ConstraintsTests.TestTypeConstraints(), null), - new CoreFXTestLibrary.Internal.TestInfo("MethodConstraintsTests.TestInvalidInstantiations", () => global::MethodConstraintsTests.TestInvalidInstantiations(), null), - new CoreFXTestLibrary.Internal.TestInfo("MethodConstraintsTests.TestSpecialConstraints", () => global::MethodConstraintsTests.TestSpecialConstraints(), null), - new CoreFXTestLibrary.Internal.TestInfo("MethodConstraintsTests.TestTypeConstraints", () => global::MethodConstraintsTests.TestTypeConstraints(), null), - new CoreFXTestLibrary.Internal.TestInfo("MethodConstraintsTests.TestMDTypeConstraints", () => global::MethodConstraintsTests.TestMDTypeConstraints(), null), - new CoreFXTestLibrary.Internal.TestInfo("Dictionaries.DictionariesTest.TestBasicDictionaryEntryTypes", () => global::Dictionaries.DictionariesTest.TestBasicDictionaryEntryTypes(), null), - new CoreFXTestLibrary.Internal.TestInfo("Dictionaries.DictionariesTest.StaticMethodFolding_Test", () => global::Dictionaries.DictionariesTest.StaticMethodFolding_Test(), null), - new CoreFXTestLibrary.Internal.TestInfo("Dictionaries.DictionariesTest.NullableTesting", () => global::Dictionaries.DictionariesTest.NullableTesting(), null), - new CoreFXTestLibrary.Internal.TestInfo("TypeDictTestTypes.DictionariesTest.TestGenericTypeDictionary", () => global::TypeDictTestTypes.DictionariesTest.TestGenericTypeDictionary(), null), - new CoreFXTestLibrary.Internal.TestInfo("MethodDictionaryTest.DictionariesTest.TestMethodDictionaries", () => global::MethodDictionaryTest.DictionariesTest.TestMethodDictionaries(), null), - new CoreFXTestLibrary.Internal.TestInfo("BaseTypeDict.Test.TestVirtCallTwoGenParams", () => global::BaseTypeDict.Test.TestVirtCallTwoGenParams(), null), - new CoreFXTestLibrary.Internal.TestInfo("BaseTypeDict.Test.TestUsingPrimitiveTypes", () => global::BaseTypeDict.Test.TestUsingPrimitiveTypes(), null), - new CoreFXTestLibrary.Internal.TestInfo("BaseTypeDict.Test.TestBaseTypeDictionaries", () => global::BaseTypeDict.Test.TestBaseTypeDictionaries(), null), - new CoreFXTestLibrary.Internal.TestInfo("DictDependency.Test.TestIndirectDictionaryDependencies", () => global::DictDependency.Test.TestIndirectDictionaryDependencies(), null), - new CoreFXTestLibrary.Internal.TestInfo("CtorDict.DictionaryTesting.TestAllocationDictionaryEntryTypes", () => global::CtorDict.DictionaryTesting.TestAllocationDictionaryEntryTypes(), null), - new CoreFXTestLibrary.Internal.TestInfo("MethodAndUnboxingStubTesting.Test.TestNoConstraints", () => global::MethodAndUnboxingStubTesting.Test.TestNoConstraints(), null), - new CoreFXTestLibrary.Internal.TestInfo("ExistingInstantiations.Test.TestWithExistingInst", () => global::ExistingInstantiations.Test.TestWithExistingInst(), null), - new CoreFXTestLibrary.Internal.TestInfo("ExistingInstantiations.Test.TestInstantiationsWithExistingArrayTypeArgs", () => global::ExistingInstantiations.Test.TestInstantiationsWithExistingArrayTypeArgs(), null), - new CoreFXTestLibrary.Internal.TestInfo("TemplateDependencyFromGenArgs.TestRunner.TemplateDependencyFromGenArgsTest", () => global::TemplateDependencyFromGenArgs.TestRunner.TemplateDependencyFromGenArgsTest(), null), + CoreFXTestLibrary.Internal.TestInfo[] tests = new CoreFXTestLibrary.Internal.TestInfo[]{new CoreFXTestLibrary.Internal.TestInfo("My.TestActivatorCreateInstance", () => global::My.TestActivatorCreateInstance(), null), +new CoreFXTestLibrary.Internal.TestInfo("My.TestDefaultCtorInLazyGenerics", () => global::My.TestDefaultCtorInLazyGenerics(), null), +new CoreFXTestLibrary.Internal.TestInfo("Expressions.ExpressionsTesting.TestLdTokenResults", () => global::Expressions.ExpressionsTesting.TestLdTokenResults(), null), +new CoreFXTestLibrary.Internal.TestInfo("Expressions.ExpressionsTesting.TestLdTokenResultsWithStructTypes", () => global::Expressions.ExpressionsTesting.TestLdTokenResultsWithStructTypes(), null), +new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestInstanceMethod", () => global::MakeGenMethod.Test.TestInstanceMethod(), null), +new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestStaticMethod", () => global::MakeGenMethod.Test.TestStaticMethod(), null), +new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestGenericMethodsWithEnumParametersHavingDefaultValues", () => global::MakeGenMethod.Test.TestGenericMethodsWithEnumParametersHavingDefaultValues(), null), +new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestNoDictionaries", () => global::MakeGenMethod.Test.TestNoDictionaries(), null), +new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestGenMethodOnGenType", () => global::MakeGenMethod.Test.TestGenMethodOnGenType(), null), +new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestReverseLookups", () => global::MakeGenMethod.Test.TestReverseLookups(), null), +new CoreFXTestLibrary.Internal.TestInfo("MakeGenMethod.Test.TestReverseLookupsWithArrayArg", () => global::MakeGenMethod.Test.TestReverseLookupsWithArrayArg(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestArrays", () => global::ArrayTests.ArrayTests.TestArrays(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestDynamicArrays", () => global::ArrayTests.ArrayTests.TestDynamicArrays(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestMDArrays", () => global::ArrayTests.ArrayTests.TestMDArrays(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestArrayIndexOfNullableStructOfCanon_USG", () => global::ArrayTests.ArrayTests.TestArrayIndexOfNullableStructOfCanon_USG(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayTests.ArrayTests.TestArrayIndexOfNullableStructOfCanon_Canon", () => global::ArrayTests.ArrayTests.TestArrayIndexOfNullableStructOfCanon_Canon(), null), +new CoreFXTestLibrary.Internal.TestInfo("BlockedTypesTests.TestBlockedTypes", () => global::BlockedTypesTests.TestBlockedTypes(), null), +new CoreFXTestLibrary.Internal.TestInfo("ConstraintsTests.TestInvalidInstantiations", () => global::ConstraintsTests.TestInvalidInstantiations(), null), +new CoreFXTestLibrary.Internal.TestInfo("ConstraintsTests.TestSpecialConstraints", () => global::ConstraintsTests.TestSpecialConstraints(), null), +new CoreFXTestLibrary.Internal.TestInfo("ConstraintsTests.TestTypeConstraints", () => global::ConstraintsTests.TestTypeConstraints(), null), +new CoreFXTestLibrary.Internal.TestInfo("MethodConstraintsTests.TestInvalidInstantiations", () => global::MethodConstraintsTests.TestInvalidInstantiations(), null), +new CoreFXTestLibrary.Internal.TestInfo("MethodConstraintsTests.TestSpecialConstraints", () => global::MethodConstraintsTests.TestSpecialConstraints(), null), +new CoreFXTestLibrary.Internal.TestInfo("MethodConstraintsTests.TestTypeConstraints", () => global::MethodConstraintsTests.TestTypeConstraints(), null), +new CoreFXTestLibrary.Internal.TestInfo("MethodConstraintsTests.TestMDTypeConstraints", () => global::MethodConstraintsTests.TestMDTypeConstraints(), null), +new CoreFXTestLibrary.Internal.TestInfo("Dictionaries.DictionariesTest.TestBasicDictionaryEntryTypes", () => global::Dictionaries.DictionariesTest.TestBasicDictionaryEntryTypes(), null), +new CoreFXTestLibrary.Internal.TestInfo("Dictionaries.DictionariesTest.StaticMethodFolding_Test", () => global::Dictionaries.DictionariesTest.StaticMethodFolding_Test(), null), +new CoreFXTestLibrary.Internal.TestInfo("Dictionaries.DictionariesTest.NullableTesting", () => global::Dictionaries.DictionariesTest.NullableTesting(), null), +new CoreFXTestLibrary.Internal.TestInfo("TypeDictTestTypes.DictionariesTest.TestGenericTypeDictionary", () => global::TypeDictTestTypes.DictionariesTest.TestGenericTypeDictionary(), null), +new CoreFXTestLibrary.Internal.TestInfo("MethodDictionaryTest.DictionariesTest.TestMethodDictionaries", () => global::MethodDictionaryTest.DictionariesTest.TestMethodDictionaries(), null), +new CoreFXTestLibrary.Internal.TestInfo("BaseTypeDict.Test.TestVirtCallTwoGenParams", () => global::BaseTypeDict.Test.TestVirtCallTwoGenParams(), null), +new CoreFXTestLibrary.Internal.TestInfo("BaseTypeDict.Test.TestUsingPrimitiveTypes", () => global::BaseTypeDict.Test.TestUsingPrimitiveTypes(), null), +new CoreFXTestLibrary.Internal.TestInfo("BaseTypeDict.Test.TestBaseTypeDictionaries", () => global::BaseTypeDict.Test.TestBaseTypeDictionaries(), null), +new CoreFXTestLibrary.Internal.TestInfo("DictDependency.Test.TestIndirectDictionaryDependencies", () => global::DictDependency.Test.TestIndirectDictionaryDependencies(), null), +new CoreFXTestLibrary.Internal.TestInfo("CtorDict.DictionaryTesting.TestAllocationDictionaryEntryTypes", () => global::CtorDict.DictionaryTesting.TestAllocationDictionaryEntryTypes(), null), +new CoreFXTestLibrary.Internal.TestInfo("MethodAndUnboxingStubTesting.Test.TestNoConstraints", () => global::MethodAndUnboxingStubTesting.Test.TestNoConstraints(), null), +new CoreFXTestLibrary.Internal.TestInfo("ExistingInstantiations.Test.TestWithExistingInst", () => global::ExistingInstantiations.Test.TestWithExistingInst(), null), +new CoreFXTestLibrary.Internal.TestInfo("ExistingInstantiations.Test.TestInstantiationsWithExistingArrayTypeArgs", () => global::ExistingInstantiations.Test.TestInstantiationsWithExistingArrayTypeArgs(), null), +new CoreFXTestLibrary.Internal.TestInfo("TemplateDependencyFromGenArgs.TestRunner.TemplateDependencyFromGenArgsTest", () => global::TemplateDependencyFromGenArgs.TestRunner.TemplateDependencyFromGenArgsTest(), null), #if UNIVERSAL_GENERICS - new CoreFXTestLibrary.Internal.TestInfo("FieldLayoutTests.TestFieldLayoutMatchesBetweenStaticAndDynamic_Long", () => global::FieldLayoutTests.TestFieldLayoutMatchesBetweenStaticAndDynamic_Long(), null), - new CoreFXTestLibrary.Internal.TestInfo("FieldLayoutTests.TestFieldLayoutMatchesBetweenStaticAndDynamic_Int64Enum", () => global::FieldLayoutTests.TestFieldLayoutMatchesBetweenStaticAndDynamic_Int64Enum(), null), - new CoreFXTestLibrary.Internal.TestInfo("FieldLayoutTests.TestBoxingUSGCreatedNullable", () => global::FieldLayoutTests.TestBoxingUSGCreatedNullable(), null), +new CoreFXTestLibrary.Internal.TestInfo("FieldLayoutTests.TestFieldLayoutMatchesBetweenStaticAndDynamic_Long", () => global::FieldLayoutTests.TestFieldLayoutMatchesBetweenStaticAndDynamic_Long(), null), +new CoreFXTestLibrary.Internal.TestInfo("FieldLayoutTests.TestFieldLayoutMatchesBetweenStaticAndDynamic_Int64Enum", () => global::FieldLayoutTests.TestFieldLayoutMatchesBetweenStaticAndDynamic_Int64Enum(), null), +new CoreFXTestLibrary.Internal.TestInfo("FieldLayoutTests.TestBoxingUSGCreatedNullable", () => global::FieldLayoutTests.TestBoxingUSGCreatedNullable(), null), #endif - new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestInstanceFieldsOnDerivedType", () => global::FieldReflectionTests.TestInstanceFieldsOnDerivedType(), null), - new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestInstanceFields", () => global::FieldReflectionTests.TestInstanceFields(), null), - new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestStaticFields", () => global::FieldReflectionTests.TestStaticFields(), null), - new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestInitializedStaticFields", () => global::FieldReflectionTests.TestInitializedStaticFields(), null), - new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestFieldSetValueOnInstantiationsThatAlreadyExistButAreNotKnownToReflection", () => global::FieldReflectionTests.TestFieldSetValueOnInstantiationsThatAlreadyExistButAreNotKnownToReflection(), null), - new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestGenericCollapsingInInterfaceMap", () => global::InterfacesTests.TestGenericCollapsingInInterfaceMap(), null), - new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestImplementedInterfaces", () => global::InterfacesTests.TestImplementedInterfaces(), null), - new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestBaseType", () => global::InterfacesTests.TestBaseType(), null), - new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestInterfaceInvoke", () => global::InterfacesTests.TestInterfaceInvoke(), null), - new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestConstrainedCall", () => global::InterfacesTests.TestConstrainedCall(), null), +new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestInstanceFieldsOnDerivedType", () => global::FieldReflectionTests.TestInstanceFieldsOnDerivedType(), null), +new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestInstanceFields", () => global::FieldReflectionTests.TestInstanceFields(), null), +new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestStaticFields", () => global::FieldReflectionTests.TestStaticFields(), null), +new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestInitializedStaticFields", () => global::FieldReflectionTests.TestInitializedStaticFields(), null), +new CoreFXTestLibrary.Internal.TestInfo("FieldReflectionTests.TestFieldSetValueOnInstantiationsThatAlreadyExistButAreNotKnownToReflection", () => global::FieldReflectionTests.TestFieldSetValueOnInstantiationsThatAlreadyExistButAreNotKnownToReflection(), null), +new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestGenericCollapsingInInterfaceMap", () => global::InterfacesTests.TestGenericCollapsingInInterfaceMap(), null), +new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestImplementedInterfaces", () => global::InterfacesTests.TestImplementedInterfaces(), null), +new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestBaseType", () => global::InterfacesTests.TestBaseType(), null), +new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestInterfaceInvoke", () => global::InterfacesTests.TestInterfaceInvoke(), null), +new CoreFXTestLibrary.Internal.TestInfo("InterfacesTests.TestConstrainedCall", () => global::InterfacesTests.TestConstrainedCall(), null), #if !MULTIMODULE_BUILD - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestGetRange", () => global::DynamicListTests.TestGetRange(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestAddRange", () => global::DynamicListTests.TestAddRange(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestAddRemove", () => global::DynamicListTests.TestAddRemove(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestIListOfT", () => global::DynamicListTests.TestIListOfT(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestICollectionOfT", () => global::DynamicListTests.TestICollectionOfT(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestIList", () => global::DynamicListTests.TestIList(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestICollection", () => global::DynamicListTests.TestICollection(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestIReadOnlyListOfT", () => global::DynamicListTests.TestIReadOnlyListOfT(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestIReadOnlyCollectionOfT", () => global::DynamicListTests.TestIReadOnlyCollectionOfT(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestToArray", () => global::DynamicListTests.TestToArray(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestContains", () => global::DynamicListTests.TestContains(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestSortWithComparison", () => global::DynamicListTests.TestSortWithComparison(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestSortWithComparer", () => global::DynamicListTests.TestSortWithComparer(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestGetRange", () => global::DynamicListTests.TestGetRange(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestAddRange", () => global::DynamicListTests.TestAddRange(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestAddRemove", () => global::DynamicListTests.TestAddRemove(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestIListOfT", () => global::DynamicListTests.TestIListOfT(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestICollectionOfT", () => global::DynamicListTests.TestICollectionOfT(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestIList", () => global::DynamicListTests.TestIList(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestICollection", () => global::DynamicListTests.TestICollection(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestIReadOnlyListOfT", () => global::DynamicListTests.TestIReadOnlyListOfT(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestIReadOnlyCollectionOfT", () => global::DynamicListTests.TestIReadOnlyCollectionOfT(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestToArray", () => global::DynamicListTests.TestToArray(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestContains", () => global::DynamicListTests.TestContains(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestSortWithComparison", () => global::DynamicListTests.TestSortWithComparison(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicListTests.TestSortWithComparer", () => global::DynamicListTests.TestSortWithComparer(), null), #endif - //new CoreFXTestLibrary.Internal.TestInfo("RdExperienceTests.TestRdExperience", () => global::RdExperienceTests.TestRdExperience(), null), - new CoreFXTestLibrary.Internal.TestInfo("StaticsTests.TestStatics", () => global::StaticsTests.TestStatics(), null), - new CoreFXTestLibrary.Internal.TestInfo("ThreadLocalStatics.TLSTesting.ThreadLocalStatics_Test", () => global::ThreadLocalStatics.TLSTesting.ThreadLocalStatics_Test(), null), +//new CoreFXTestLibrary.Internal.TestInfo("RdExperienceTests.TestRdExperience", () => global::RdExperienceTests.TestRdExperience(), null), +new CoreFXTestLibrary.Internal.TestInfo("StaticsTests.TestStatics", () => global::StaticsTests.TestStatics(), null), +new CoreFXTestLibrary.Internal.TestInfo("ThreadLocalStatics.TLSTesting.ThreadLocalStatics_Test", () => global::ThreadLocalStatics.TLSTesting.ThreadLocalStatics_Test(), null), #if UNIVERSAL_GENERICS - new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestRefTypeCallsOnNonGenClass", () => global::UnivConstCalls.Test.TestRefTypeCallsOnNonGenClass(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestUSCCallsOnNonGenStruct", () => global::UnivConstCalls.Test.TestUSCCallsOnNonGenStruct(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestUSCCallsOnSharedGenStruct", () => global::UnivConstCalls.Test.TestUSCCallsOnSharedGenStruct(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestUSCCallsOnUSCGenStruct", () => global::UnivConstCalls.Test.TestUSCCallsOnUSCGenStruct(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestUSCNonGenInterfaceCallsOnStructs", () => global::UnivConstCalls.Test.TestUSCNonGenInterfaceCallsOnStructs(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestInterlockedPrimitives", () => global::UniversalGen.Test.TestInterlockedPrimitives(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestArraysAndGC", () => global::UniversalGen.Test.TestArraysAndGC(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSGByRefFunctionCalls", () => global::UniversalGen.Test.TestUSGByRefFunctionCalls(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSGSamples", () => global::UniversalGen.Test.TestUSGSamples(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestMakeGenericType", () => global::UniversalGen.Test.TestMakeGenericType(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCInstanceFieldUsage", () => global::UniversalGen.Test.TestUSCInstanceFieldUsage(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCStaticFieldUsage", () => global::UniversalGen.Test.TestUSCStaticFieldUsage(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCThreadStaticFieldUsage", () => global::UniversalGen.Test.TestUSCThreadStaticFieldUsage(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCStaticFieldLayoutCompat", () => global::UniversalGen.Test.TestUSCStaticFieldLayoutCompat(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCClassConstructorImplicit", () => global::UniversalGen.Test.TestUSCClassConstructorImplicit(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCClassConstructorExplicit", () => global::UniversalGen.Test.TestUSCClassConstructorExplicit(), null), - new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUniversalGenericsGvmCall", () => global::UniversalGen.Test.TestUniversalGenericsGvmCall(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUSC.Test.TestVirtualCallsPartialUSGVTableMismatch", () => global::PartialUSC.Test.TestVirtualCallsPartialUSGVTableMismatch(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUSC.Test.TestVirtualCalls", () => global::PartialUSC.Test.TestVirtualCalls(), null), - new CoreFXTestLibrary.Internal.TestInfo("VirtualCalls.Test.TestVirtualCalls", () => global::VirtualCalls.Test.TestVirtualCalls(), null), - new CoreFXTestLibrary.Internal.TestInfo("CallingConvention.Test.TestInstancesOfKnownAndUnknownSizes", () => global::CallingConvention.Test.TestInstancesOfKnownAndUnknownSizes(), null), - new CoreFXTestLibrary.Internal.TestInfo("CallingConvention.Test.TestCallInstanceFunction", () => global::CallingConvention.Test.TestCallInstanceFunction(), null), - new CoreFXTestLibrary.Internal.TestInfo("CallingConvention.Test.TestCallInterface", () => global::CallingConvention.Test.TestCallInterface(), null), - new CoreFXTestLibrary.Internal.TestInfo("CallingConvention.Test.CallingConventionTest", () => global::CallingConvention.Test.CallingConventionTest(), null), - new CoreFXTestLibrary.Internal.TestInfo("DynamicInvoke.Test.TestDynamicInvoke", () => global::DynamicInvoke.Test.TestDynamicInvoke(), null), - new CoreFXTestLibrary.Internal.TestInfo("TypeLayout.Test.TestTypeGCDescs", () => global::TypeLayout.Test.TestTypeGCDescs(), null), - new CoreFXTestLibrary.Internal.TestInfo("TypeLayout.Test.StructsOfPrimitives", () => global::TypeLayout.Test.StructsOfPrimitives(), null), - new CoreFXTestLibrary.Internal.TestInfo("ActivatorCreateInstance.Test.TestCreateInstance", () => global::ActivatorCreateInstance.Test.TestCreateInstance(), null), - new CoreFXTestLibrary.Internal.TestInfo("MultiThreadUSCCall.Test.CallsWithGCCollects", () => global::MultiThreadUSCCall.Test.CallsWithGCCollects(), null), - new CoreFXTestLibrary.Internal.TestInfo("Heuristics.TestHeuristics.TestReflectionHeuristics", () => global::Heuristics.TestHeuristics.TestReflectionHeuristics(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayVarianceTest.Test.RunTest", () => global::ArrayVarianceTest.Test.RunTest(), null), - new CoreFXTestLibrary.Internal.TestInfo("IsInstTest.TestRunner.RunIsInstAndCheckCastTest", () => global::IsInstTest.TestRunner.RunIsInstAndCheckCastTest(), null), - new CoreFXTestLibrary.Internal.TestInfo("DelegateCallTest.TestRunner.TestCallMethodThroughUsgDelegate", () => global::DelegateCallTest.TestRunner.TestCallMethodThroughUsgDelegate(), null), - new CoreFXTestLibrary.Internal.TestInfo("FieldLayoutBugRepro.Runner.EntryPoint", () => global::FieldLayoutBugRepro.Runner.EntryPoint(), null), - new CoreFXTestLibrary.Internal.TestInfo("DelegateTest.TestRunner.TestMethodCellsWithUSGTargetsUsedOnNonUSGInstantiations", () => global::DelegateTest.TestRunner.TestMethodCellsWithUSGTargetsUsedOnNonUSGInstantiations(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayExceptionsTest.Runner.ArrayExceptionsTest_String_Object", () => global::ArrayExceptionsTest.Runner.ArrayExceptionsTest_String_Object(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayExceptionsTest.Runner.ArrayExceptionsTest_Int32_Int32", () => global::ArrayExceptionsTest.Runner.ArrayExceptionsTest_Int32_Int32(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayExceptionsTest.Runner.ArrayExceptionsTest_Int32_IntBasedEnum", () => global::ArrayExceptionsTest.Runner.ArrayExceptionsTest_Int32_IntBasedEnum(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayExceptionsTest.Runner.ArrayExceptionsTest_UInt32_Int32", () => global::ArrayExceptionsTest.Runner.ArrayExceptionsTest_UInt32_Int32(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToString", () => global::UnboxAnyTests.Runner.TestUnboxAnyToString(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToInt", () => global::UnboxAnyTests.Runner.TestUnboxAnyToInt(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToIntBasedEnum", () => global::UnboxAnyTests.Runner.TestUnboxAnyToIntBasedEnum(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToNullableInt", () => global::UnboxAnyTests.Runner.TestUnboxAnyToNullableInt(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToNullableIntBasedEnum", () => global::UnboxAnyTests.Runner.TestUnboxAnyToNullableIntBasedEnum(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToShort_NonUSG", () => global::UnboxAnyTests.Runner.TestUnboxAnyToShort_NonUSG(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToShortBasedEnum_NonUSG", () => global::UnboxAnyTests.Runner.TestUnboxAnyToShortBasedEnum_NonUSG(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToNullableShort_NonUSG", () => global::UnboxAnyTests.Runner.TestUnboxAnyToNullableShort_NonUSG(), null), - new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToNullableShortBasedEnum_NonUSG", () => global::UnboxAnyTests.Runner.TestUnboxAnyToNullableShortBasedEnum_NonUSG(), null), - new CoreFXTestLibrary.Internal.TestInfo("HFATest.Runner.HFATestEntryPoint", () => global::HFATest.Runner.HFATestEntryPoint(), null), - new CoreFXTestLibrary.Internal.TestInfo("ComparerOfTTests.Runner.TestStructThatImplementsIComparable", () => global::ComparerOfTTests.Runner.TestStructThatImplementsIComparable(), null), - new CoreFXTestLibrary.Internal.TestInfo("ComparerOfTTests.Runner.TestStructThatImplementsIComparableOfObject", () => global::ComparerOfTTests.Runner.TestStructThatImplementsIComparableOfObject(), null), - new CoreFXTestLibrary.Internal.TestInfo("ComparerOfTTests.Runner.TestBoringStruct", () => global::ComparerOfTTests.Runner.TestBoringStruct(), null), - new CoreFXTestLibrary.Internal.TestInfo("DefaultValueDelegateParameterTests.Runner.TestCallUniversalGenericDelegate", () => global::DefaultValueDelegateParameterTests.Runner.TestCallUniversalGenericDelegate(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayOfGenericStructGCTests.Runner.TestArrayOfGenericStructGCTests", () => global::ArrayOfGenericStructGCTests.Runner.TestArrayOfGenericStructGCTests(), null), - new CoreFXTestLibrary.Internal.TestInfo("ArrayOfGenericStructGCTests.Runner.TestNonPointerSizedFinalField", () => global::ArrayOfGenericStructGCTests.Runner.TestNonPointerSizedFinalField(), null), - new CoreFXTestLibrary.Internal.TestInfo("DelegatesToStructMethods.Runner.TestDelegateInvokeToMethods", () => global::DelegatesToStructMethods.Runner.TestDelegateInvokeToMethods(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestOverrideMethodOnDerivedTypeWhereInstantiationArgsAreDifferentThanBaseType", () => global::PartialUniversalGen.Test.TestOverrideMethodOnDerivedTypeWhereInstantiationArgsAreDifferentThanBaseType(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatDerivesFromBaseInstantiatedOverArray", () => global::PartialUniversalGen.Test.TestUniversalGenericThatDerivesFromBaseInstantiatedOverArray(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGeneric", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGeneric(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatImplementsInterfaceOverArrayType", () => global::PartialUniversalGen.Test.TestUniversalGenericThatImplementsInterfaceOverArrayType(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethod", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethod(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethodWithActivatorCreateInstance", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethodWithActivatorCreateInstance(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericType", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericType(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethodWithConstraints", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethodWithConstraints(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestDependenciesOfPartialUniversalCanonicalCode", () => global::PartialUniversalGen.Test.TestDependenciesOfPartialUniversalCanonicalCode(), null), - new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestCornerCaseSealedVTableSlot", () => global::PartialUniversalGen.Test.TestCornerCaseSealedVTableSlot(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestRefTypeCallsOnNonGenClass", () => global::UnivConstCalls.Test.TestRefTypeCallsOnNonGenClass(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestUSCCallsOnNonGenStruct", () => global::UnivConstCalls.Test.TestUSCCallsOnNonGenStruct(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestUSCCallsOnSharedGenStruct", () => global::UnivConstCalls.Test.TestUSCCallsOnSharedGenStruct(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestUSCCallsOnUSCGenStruct", () => global::UnivConstCalls.Test.TestUSCCallsOnUSCGenStruct(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnivConstCalls.Test.TestUSCNonGenInterfaceCallsOnStructs", () => global::UnivConstCalls.Test.TestUSCNonGenInterfaceCallsOnStructs(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestInterlockedPrimitives", () => global::UniversalGen.Test.TestInterlockedPrimitives(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestArraysAndGC", () => global::UniversalGen.Test.TestArraysAndGC(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSGByRefFunctionCalls", () => global::UniversalGen.Test.TestUSGByRefFunctionCalls(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSGSamples", () => global::UniversalGen.Test.TestUSGSamples(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestMakeGenericType", () => global::UniversalGen.Test.TestMakeGenericType(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCInstanceFieldUsage", () => global::UniversalGen.Test.TestUSCInstanceFieldUsage(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCStaticFieldUsage", () => global::UniversalGen.Test.TestUSCStaticFieldUsage(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCThreadStaticFieldUsage", () => global::UniversalGen.Test.TestUSCThreadStaticFieldUsage(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCStaticFieldLayoutCompat", () => global::UniversalGen.Test.TestUSCStaticFieldLayoutCompat(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCClassConstructorImplicit", () => global::UniversalGen.Test.TestUSCClassConstructorImplicit(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUSCClassConstructorExplicit", () => global::UniversalGen.Test.TestUSCClassConstructorExplicit(), null), +new CoreFXTestLibrary.Internal.TestInfo("UniversalGen.Test.TestUniversalGenericsGvmCall", () => global::UniversalGen.Test.TestUniversalGenericsGvmCall(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUSC.Test.TestVirtualCallsPartialUSGVTableMismatch", () => global::PartialUSC.Test.TestVirtualCallsPartialUSGVTableMismatch(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUSC.Test.TestVirtualCalls", () => global::PartialUSC.Test.TestVirtualCalls(), null), +new CoreFXTestLibrary.Internal.TestInfo("VirtualCalls.Test.TestVirtualCalls", () => global::VirtualCalls.Test.TestVirtualCalls(), null), +new CoreFXTestLibrary.Internal.TestInfo("CallingConvention.Test.TestInstancesOfKnownAndUnknownSizes", () => global::CallingConvention.Test.TestInstancesOfKnownAndUnknownSizes(), null), +new CoreFXTestLibrary.Internal.TestInfo("CallingConvention.Test.TestCallInstanceFunction", () => global::CallingConvention.Test.TestCallInstanceFunction(), null), +new CoreFXTestLibrary.Internal.TestInfo("CallingConvention.Test.TestCallInterface", () => global::CallingConvention.Test.TestCallInterface(), null), +new CoreFXTestLibrary.Internal.TestInfo("CallingConvention.Test.CallingConventionTest", () => global::CallingConvention.Test.CallingConventionTest(), null), +new CoreFXTestLibrary.Internal.TestInfo("DynamicInvoke.Test.TestDynamicInvoke", () => global::DynamicInvoke.Test.TestDynamicInvoke(), null), +new CoreFXTestLibrary.Internal.TestInfo("TypeLayout.Test.TestTypeGCDescs", () => global::TypeLayout.Test.TestTypeGCDescs(), null), +new CoreFXTestLibrary.Internal.TestInfo("TypeLayout.Test.StructsOfPrimitives", () => global::TypeLayout.Test.StructsOfPrimitives(), null), +new CoreFXTestLibrary.Internal.TestInfo("ActivatorCreateInstance.Test.TestCreateInstance", () => global::ActivatorCreateInstance.Test.TestCreateInstance(), null), +new CoreFXTestLibrary.Internal.TestInfo("MultiThreadUSCCall.Test.CallsWithGCCollects", () => global::MultiThreadUSCCall.Test.CallsWithGCCollects(), null), +new CoreFXTestLibrary.Internal.TestInfo("Heuristics.TestHeuristics.TestReflectionHeuristics", () => global::Heuristics.TestHeuristics.TestReflectionHeuristics(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayVarianceTest.Test.RunTest", () => global::ArrayVarianceTest.Test.RunTest(), null), +new CoreFXTestLibrary.Internal.TestInfo("IsInstTest.TestRunner.RunIsInstAndCheckCastTest", () => global::IsInstTest.TestRunner.RunIsInstAndCheckCastTest(), null), +new CoreFXTestLibrary.Internal.TestInfo("DelegateCallTest.TestRunner.TestCallMethodThroughUsgDelegate", () => global::DelegateCallTest.TestRunner.TestCallMethodThroughUsgDelegate(), null), +new CoreFXTestLibrary.Internal.TestInfo("FieldLayoutBugRepro.Runner.EntryPoint", () => global::FieldLayoutBugRepro.Runner.EntryPoint(), null), +new CoreFXTestLibrary.Internal.TestInfo("DelegateTest.TestRunner.TestMethodCellsWithUSGTargetsUsedOnNonUSGInstantiations", () => global::DelegateTest.TestRunner.TestMethodCellsWithUSGTargetsUsedOnNonUSGInstantiations(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayExceptionsTest.Runner.ArrayExceptionsTest_String_Object", () => global::ArrayExceptionsTest.Runner.ArrayExceptionsTest_String_Object(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayExceptionsTest.Runner.ArrayExceptionsTest_Int32_Int32", () => global::ArrayExceptionsTest.Runner.ArrayExceptionsTest_Int32_Int32(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayExceptionsTest.Runner.ArrayExceptionsTest_Int32_IntBasedEnum", () => global::ArrayExceptionsTest.Runner.ArrayExceptionsTest_Int32_IntBasedEnum(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayExceptionsTest.Runner.ArrayExceptionsTest_UInt32_Int32", () => global::ArrayExceptionsTest.Runner.ArrayExceptionsTest_UInt32_Int32(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToString", () => global::UnboxAnyTests.Runner.TestUnboxAnyToString(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToInt", () => global::UnboxAnyTests.Runner.TestUnboxAnyToInt(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToIntBasedEnum", () => global::UnboxAnyTests.Runner.TestUnboxAnyToIntBasedEnum(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToNullableInt", () => global::UnboxAnyTests.Runner.TestUnboxAnyToNullableInt(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToNullableIntBasedEnum", () => global::UnboxAnyTests.Runner.TestUnboxAnyToNullableIntBasedEnum(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToShort_NonUSG", () => global::UnboxAnyTests.Runner.TestUnboxAnyToShort_NonUSG(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToShortBasedEnum_NonUSG", () => global::UnboxAnyTests.Runner.TestUnboxAnyToShortBasedEnum_NonUSG(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToNullableShort_NonUSG", () => global::UnboxAnyTests.Runner.TestUnboxAnyToNullableShort_NonUSG(), null), +new CoreFXTestLibrary.Internal.TestInfo("UnboxAnyTests.Runner.TestUnboxAnyToNullableShortBasedEnum_NonUSG", () => global::UnboxAnyTests.Runner.TestUnboxAnyToNullableShortBasedEnum_NonUSG(), null), +new CoreFXTestLibrary.Internal.TestInfo("HFATest.Runner.HFATestEntryPoint", () => global::HFATest.Runner.HFATestEntryPoint(), null), +new CoreFXTestLibrary.Internal.TestInfo("ComparerOfTTests.Runner.TestStructThatImplementsIComparable", () => global::ComparerOfTTests.Runner.TestStructThatImplementsIComparable(), null), +new CoreFXTestLibrary.Internal.TestInfo("ComparerOfTTests.Runner.TestStructThatImplementsIComparableOfObject", () => global::ComparerOfTTests.Runner.TestStructThatImplementsIComparableOfObject(), null), +new CoreFXTestLibrary.Internal.TestInfo("ComparerOfTTests.Runner.TestBoringStruct", () => global::ComparerOfTTests.Runner.TestBoringStruct(), null), +new CoreFXTestLibrary.Internal.TestInfo("DefaultValueDelegateParameterTests.Runner.TestCallUniversalGenericDelegate", () => global::DefaultValueDelegateParameterTests.Runner.TestCallUniversalGenericDelegate(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayOfGenericStructGCTests.Runner.TestArrayOfGenericStructGCTests", () => global::ArrayOfGenericStructGCTests.Runner.TestArrayOfGenericStructGCTests(), null), +new CoreFXTestLibrary.Internal.TestInfo("ArrayOfGenericStructGCTests.Runner.TestNonPointerSizedFinalField", () => global::ArrayOfGenericStructGCTests.Runner.TestNonPointerSizedFinalField(), null), +new CoreFXTestLibrary.Internal.TestInfo("DelegatesToStructMethods.Runner.TestDelegateInvokeToMethods", () => global::DelegatesToStructMethods.Runner.TestDelegateInvokeToMethods(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestOverrideMethodOnDerivedTypeWhereInstantiationArgsAreDifferentThanBaseType", () => global::PartialUniversalGen.Test.TestOverrideMethodOnDerivedTypeWhereInstantiationArgsAreDifferentThanBaseType(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatDerivesFromBaseInstantiatedOverArray", () => global::PartialUniversalGen.Test.TestUniversalGenericThatDerivesFromBaseInstantiatedOverArray(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGeneric", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGeneric(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatImplementsInterfaceOverArrayType", () => global::PartialUniversalGen.Test.TestUniversalGenericThatImplementsInterfaceOverArrayType(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethod", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethod(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethodWithActivatorCreateInstance", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethodWithActivatorCreateInstance(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericType", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericType(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethodWithConstraints", () => global::PartialUniversalGen.Test.TestUniversalGenericThatUsesCanonicalGenericMethodWithConstraints(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestDependenciesOfPartialUniversalCanonicalCode", () => global::PartialUniversalGen.Test.TestDependenciesOfPartialUniversalCanonicalCode(), null), +new CoreFXTestLibrary.Internal.TestInfo("PartialUniversalGen.Test.TestCornerCaseSealedVTableSlot", () => global::PartialUniversalGen.Test.TestCornerCaseSealedVTableSlot(), null), #endif - new CoreFXTestLibrary.Internal.TestInfo("B282745.testIntMDArrayWithPointerLikeValues", () => global::B282745.testIntMDArrayWithPointerLikeValues(), null), - new CoreFXTestLibrary.Internal.TestInfo("B282745.testLongMDArrayWithPointerLikeValues", () => global::B282745.testLongMDArrayWithPointerLikeValues(), null), - new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfKnownStructType", () => global::B282745.testMDArrayWithPointerLikeValuesOfKnownStructType(), null), - new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfKnownStructTypeLargerType", () => global::B282745.testMDArrayWithPointerLikeValuesOfKnownStructTypeLargerType(), null), - new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset", () => global::B282745.testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset(), null), - new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfUnknownStructReferenceType", () => global::B282745.testMDArrayWithPointerLikeValuesOfUnknownStructReferenceType(), null), - new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfUnknownStructPrimitiveType", () => global::B282745.testMDArrayWithPointerLikeValuesOfUnknownStructPrimitiveType(), null), - new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWith3Dimensions", () => global::B282745.testMDArrayWith3Dimensions(), null), +new CoreFXTestLibrary.Internal.TestInfo("B282745.testIntMDArrayWithPointerLikeValues", () => global::B282745.testIntMDArrayWithPointerLikeValues(), null), +new CoreFXTestLibrary.Internal.TestInfo("B282745.testLongMDArrayWithPointerLikeValues", () => global::B282745.testLongMDArrayWithPointerLikeValues(), null), +new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfKnownStructType", () => global::B282745.testMDArrayWithPointerLikeValuesOfKnownStructType(), null), +new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfKnownStructTypeLargerType", () => global::B282745.testMDArrayWithPointerLikeValuesOfKnownStructTypeLargerType(), null), +new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset", () => global::B282745.testMDArrayWithPointerLikeValuesOfUnknownStructTypeWithNonGCValuesAtZeroOffset(), null), +new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfUnknownStructReferenceType", () => global::B282745.testMDArrayWithPointerLikeValuesOfUnknownStructReferenceType(), null), +new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWithPointerLikeValuesOfUnknownStructPrimitiveType", () => global::B282745.testMDArrayWithPointerLikeValuesOfUnknownStructPrimitiveType(), null), +new CoreFXTestLibrary.Internal.TestInfo("B282745.testMDArrayWith3Dimensions", () => global::B282745.testMDArrayWith3Dimensions(), null), #if UNIVERSAL_GENERICS - new CoreFXTestLibrary.Internal.TestInfo("B279085.TestB279085Repro", () => global::B279085.TestB279085Repro(), null), +new CoreFXTestLibrary.Internal.TestInfo("B279085.TestB279085Repro", () => global::B279085.TestB279085Repro(), null), #endif - new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestCalls", () => global::GenericVirtualMethods.TestCalls(), null), - new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestLdFtnToGetStaticMethodOnGenericType", () => global::GenericVirtualMethods.TestLdFtnToGetStaticMethodOnGenericType(), null), - new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestLdFtnToInstanceGenericMethod", () => global::GenericVirtualMethods.TestLdFtnToInstanceGenericMethod(), null), - // https://github.com/dotnet/corert/issues/3460 - //new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestGenericExceptionType", () => global::GenericVirtualMethods.TestGenericExceptionType(), null), - new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestCoAndContraVariantCalls", () => global::GenericVirtualMethods.TestCoAndContraVariantCalls(), null) - }; - - // This is a placeholder for the RunTests() call below that expects an - // args array as a parameter. Tests using the Merged Wrapper system rely - // on the TestEntryPoint(), which receives no parameters, whereas the - // legacy system had a Main(string[] args) signature. However, in this - // specific test's case, the args array was always empty. - string[] args = new string[] { }; - +new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestCalls", () => global::GenericVirtualMethods.TestCalls(), null), +new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestLdFtnToGetStaticMethodOnGenericType", () => global::GenericVirtualMethods.TestLdFtnToGetStaticMethodOnGenericType(), null), +new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestLdFtnToInstanceGenericMethod", () => global::GenericVirtualMethods.TestLdFtnToInstanceGenericMethod(), null), +// https://github.com/dotnet/corert/issues/3460 +//new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestGenericExceptionType", () => global::GenericVirtualMethods.TestGenericExceptionType(), null), +new CoreFXTestLibrary.Internal.TestInfo("GenericVirtualMethods.TestCoAndContraVariantCalls", () => global::GenericVirtualMethods.TestCoAndContraVariantCalls(), null) +}; bool passed = CoreFXTestLibrary.Internal.Runner.RunTests(tests, args); - CoreFXTestLibrary.Logger.LogInformation("Passed: {0}, Failed: {1}, Number of Tests Run: {2}", - CoreFXTestLibrary.Internal.Runner.NumPassedTests, - CoreFXTestLibrary.Internal.Runner.NumFailedTests, - CoreFXTestLibrary.Internal.Runner.NumTests); - + CoreFXTestLibrary.Logger.LogInformation("Passed: {0}, Failed: {1}, Number of Tests Run: {2}", CoreFXTestLibrary.Internal.Runner.NumPassedTests, CoreFXTestLibrary.Internal.Runner.NumFailedTests, CoreFXTestLibrary.Internal.Runner.NumTests); if (passed && CoreFXTestLibrary.Internal.Runner.NumPassedTests > 0) { CoreFXTestLibrary.Logger.LogInformation("All tests PASSED."); diff --git a/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs b/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs index 47f2bf225da01e..55028fdee9adb9 100644 --- a/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs +++ b/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs @@ -5,7 +5,6 @@ using System.Diagnostics; using System.Runtime.ExceptionServices; using System.Text; -using Xunit; public class BringUpTest { @@ -24,8 +23,7 @@ public BringUpTest() static int finallyCounter = 0; - [Fact] - public static int TestEntryPoint() + public static int Main() { // This test also doubles as server GC test if (!System.Runtime.GCSettings.IsServerGC) diff --git a/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.csproj b/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.csproj index 896199de3bbd52..3962aa3e39b918 100644 --- a/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.csproj +++ b/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.csproj @@ -1,13 +1,12 @@ + Exe 0 true true - true true - diff --git a/src/tests/nativeaot/SmokeTests/FrameworkStrings/Baseline.csproj b/src/tests/nativeaot/SmokeTests/FrameworkStrings/Baseline.csproj index be8f0ceb122728..111baa46052bfc 100644 --- a/src/tests/nativeaot/SmokeTests/FrameworkStrings/Baseline.csproj +++ b/src/tests/nativeaot/SmokeTests/FrameworkStrings/Baseline.csproj @@ -1,11 +1,10 @@ + Exe 0 - true true - diff --git a/src/tests/nativeaot/SmokeTests/FrameworkStrings/Program.cs b/src/tests/nativeaot/SmokeTests/FrameworkStrings/Program.cs index 2ffadce22a0798..73b0b99b29b6ee 100644 --- a/src/tests/nativeaot/SmokeTests/FrameworkStrings/Program.cs +++ b/src/tests/nativeaot/SmokeTests/FrameworkStrings/Program.cs @@ -3,95 +3,73 @@ using System; using System.Collections.Generic; -using Xunit; -public class Program -{ - [Fact] - public static int TestEntryPoint() - { - // Exception message from CoreLib - const string expectedNullRefMessage = +// Exception message from CoreLib +const string expectedNullRefMessage = #if RESOURCE_KEYS - "Arg_NullReferenceException"; + "Arg_NullReferenceException"; #else - "Object reference not set to an instance of an object."; + "Object reference not set to an instance of an object."; #endif +string actualNullRefMessage = new NullReferenceException().Message; +Console.WriteLine(expectedNullRefMessage); +Console.WriteLine(actualNullRefMessage); +if (actualNullRefMessage != expectedNullRefMessage) +{ + throw new Exception(); +} - string actualNullRefMessage = new NullReferenceException().Message; - Console.WriteLine(expectedNullRefMessage); - Console.WriteLine(actualNullRefMessage); - - if (actualNullRefMessage != expectedNullRefMessage) - { - Console.WriteLine("Null Reference Messages Differed."); - return 101; - } - - // Some exception message from the reflection library. - const string expectedReflectionMessage = +// Some exception message from the reflection library. +const string expectedReflectionMessage = #if RESOURCE_KEYS - "Argument_ArrayGetInterfaceMap"; + "Argument_ArrayGetInterfaceMap"; #else - "Interface maps for generic interfaces on arrays cannot be retrieved."; + "Interface maps for generic interfaces on arrays cannot be retrieved."; #endif +string actualReflectionMessage; +try +{ + typeof(int[]).GetInterfaceMap(typeof(IEnumerable)); + actualReflectionMessage = "I guess we need to update the test"; +} +catch (Exception ex) +{ + actualReflectionMessage = ex.Message; +} +Console.WriteLine(expectedReflectionMessage); +Console.WriteLine(actualReflectionMessage); +if (expectedReflectionMessage != actualReflectionMessage) +{ + throw new Exception(actualReflectionMessage); +} - string actualReflectionMessage; - try - { - typeof(int[]).GetInterfaceMap(typeof(IEnumerable)); - actualReflectionMessage = "I guess we need to update the test"; - } - catch (Exception ex) - { - actualReflectionMessage = ex.Message; - } - - Console.WriteLine(expectedReflectionMessage); - Console.WriteLine(actualReflectionMessage); - - if (expectedReflectionMessage != actualReflectionMessage) - { - Console.WriteLine("Reflection Messages Differed."); - return 101; - } - - Console.WriteLine("Resources in CoreLib:"); - string[] coreLibNames = typeof(object).Assembly.GetManifestResourceNames(); - foreach (var name in coreLibNames) - Console.WriteLine(name); +Console.WriteLine("Resources in CoreLib:"); +string[] coreLibNames = typeof(object).Assembly.GetManifestResourceNames(); +foreach (var name in coreLibNames) + Console.WriteLine(name); #if RESOURCE_KEYS - if (coreLibNames.Length != 0) - { - Console.WriteLine($"Found {coreLibNames.Length} CoreLib Resources" - + " but expected 0."); - return 101; - } +if (coreLibNames.Length != 0) + throw new Exception(); #endif - Console.WriteLine("Resources in reflection library:"); - string[] refNames; - const string reflectionAssembly = "System.Private.Reflection.Execution"; - try - { - refNames = System.Reflection.Assembly.Load(reflectionAssembly).GetManifestResourceNames(); - } - catch (System.IO.FileNotFoundException) - { - refNames = Array.Empty(); - } - foreach (var name in refNames) - Console.WriteLine(name); +Console.WriteLine("Resources in reflection library:"); +string[] refNames; +const string reflectionAssembly = "System.Private.Reflection.Execution"; +try +{ + refNames = System.Reflection.Assembly.Load(reflectionAssembly).GetManifestResourceNames(); +} +catch (System.IO.FileNotFoundException) +{ + refNames = Array.Empty(); +} +foreach (var name in refNames) + Console.WriteLine(name); #if RESOURCE_KEYS - if (refNames.Length != 0) - { - Console.WriteLine($"Found {refNames.Length} Reflection Library Resources" - + " but expected 0."); - return 101; - } +if (refNames.Length != 0) + throw new Exception(); #endif - return 100; - } -} + +return 100; diff --git a/src/tests/nativeaot/SmokeTests/FrameworkStrings/UseSystemResourceKeys.csproj b/src/tests/nativeaot/SmokeTests/FrameworkStrings/UseSystemResourceKeys.csproj index 9e78b998077c62..752d76b2687c3c 100644 --- a/src/tests/nativeaot/SmokeTests/FrameworkStrings/UseSystemResourceKeys.csproj +++ b/src/tests/nativeaot/SmokeTests/FrameworkStrings/UseSystemResourceKeys.csproj @@ -1,8 +1,8 @@ + Exe 0 $(DefineConstants);RESOURCE_KEYS - true true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs index 6b09d24ae2ae7e..e628938c57db82 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs @@ -6,12 +6,10 @@ using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; -using Xunit; -public unsafe class Program +unsafe class Program { - [Fact] - public static int TestEntryPoint() + static int Main() { s_success = true; @@ -28,9 +26,7 @@ public static int TestEntryPoint() if (fileSize < lowerBound || fileSize > upperBound) { - Console.WriteLine($"BUG: File size is not in the expected range" - + " ({lowerBound} to {upperBound} bytes). Did a" - + " libraries change regress size of Hello World?"); + Console.WriteLine($"BUG: File size is not in the expected range ({lowerBound} to {upperBound} bytes). Did a libraries change regress size of Hello World?"); return 1; } diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx.csproj index 509d26f40a14e1..8684274f76590c 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx.csproj @@ -1,7 +1,7 @@ + Exe 0 - true true true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx2.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx2.csproj index 9707a29b2746e8..32679f7769eb32 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx2.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx2.csproj @@ -1,8 +1,7 @@ + Exe 0 - true - true true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx512.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx512.csproj index adfddf609f7def..80bd8b2645c5e2 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx512.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx512.csproj @@ -1,8 +1,7 @@ + Exe 0 - true - true true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx_NoAvx2.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx_NoAvx2.csproj index e3f6131721bd8a..ac6528e395032a 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx_NoAvx2.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx_NoAvx2.csproj @@ -1,8 +1,7 @@ + Exe 0 - true - true true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj index 1044e39468903a..e86d21b891b768 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj @@ -1,8 +1,7 @@ + Exe 0 - true - true true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Sse42.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Sse42.csproj index aae07ae7d145b2..7d3c1b84c128f3 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Sse42.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Sse42.csproj @@ -1,8 +1,7 @@ + Exe 0 - true - true true diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/Library.csproj b/src/tests/nativeaot/SmokeTests/MultiModule/Library.csproj index 06689f14d05758..fbce99fa4fb515 100644 --- a/src/tests/nativeaot/SmokeTests/MultiModule/Library.csproj +++ b/src/tests/nativeaot/SmokeTests/MultiModule/Library.csproj @@ -3,7 +3,6 @@ Library true - diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj index 7536c7d390b393..5cfd47f9128cf8 100644 --- a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj +++ b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj @@ -3,17 +3,14 @@ Exe 0 true - true true true - - diff --git a/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.cs b/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.cs index bf2c8ab5106e8a..92fc0284e913e2 100644 --- a/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.cs +++ b/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.cs @@ -11,7 +11,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; -using Xunit; // Make sure the interop data are present even without reflection namespace System.Runtime.CompilerServices @@ -24,7 +23,7 @@ internal class __BlockAllReflectionAttribute : Attribute { } // ensure that we can handle this (mostly an issue for C++ code generation). namespace PInvokeTests { - public class Program + internal class Program { [DllImport("PInvokeNative", CallingConvention = CallingConvention.StdCall)] private static extern int Square(int intValue); @@ -140,12 +139,11 @@ private static extern bool VerifySizeParamIndex( #else [MethodImpl(MethodImplOptions.AggressiveInlining)] #endif - static extern bool ReversePInvoke_Int_AggressiveInlining(Delegate_Int_AggressiveInlining del); + [UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet=CharSet.Ansi)] delegate bool Delegate_String(string s); - [DllImport("PInvokeNative", CallingConvention = CallingConvention.StdCall)] static extern bool ReversePInvoke_String(Delegate_String del); @@ -173,13 +171,11 @@ struct FieldMulticastDelegate [UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Ansi)] delegate bool Delegate_OutString([MarshalAs(0x30)] out string s); - [DllImport("PInvokeNative", CallingConvention = CallingConvention.StdCall)] static extern bool ReversePInvoke_OutString(Delegate_OutString del); [UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Ansi)] delegate bool Delegate_Array([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] int[] array, IntPtr sz); - [DllImport("PInvokeNative", CallingConvention = CallingConvention.StdCall)] static extern bool ReversePInvoke_Array(Delegate_Array del); @@ -190,7 +186,6 @@ struct FieldMulticastDelegate static extern bool Callback(ref Delegate_String d); delegate void Delegate_Unused(); - [DllImport("PInvokeNative", CallingConvention = CallingConvention.StdCall)] static extern unsafe int* ReversePInvoke_Unused(Delegate_Unused del); @@ -327,8 +322,7 @@ internal enum MagicEnum MagicResult = 42, } - [Fact] - public static int TestEntryPoint() + public static int Main() { TestBlittableType(); TestBoolean(); diff --git a/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.csproj b/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.csproj index d4ac6c29eb1501..0a7a956d1f89fa 100644 --- a/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.csproj +++ b/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.csproj @@ -1,7 +1,7 @@ + Exe true - true $(NoWarn);IL3055 @@ -11,11 +11,9 @@ true - - diff --git a/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs b/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs index 5af0dac25c4192..78223dca967fe4 100644 --- a/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs +++ b/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs @@ -7,14 +7,12 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics.X86; -using Xunit; using BindingFlags = System.Reflection.BindingFlags; -public class Program +internal class Program { - [Fact] - public static int TestEntryPoint() + private static int Main() { #if !MULTIMODULE_BUILD TestHardwareIntrinsics.Run(); diff --git a/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.csproj b/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.csproj index 0b9891d4a036c3..fde40cfb5e69d6 100644 --- a/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.csproj +++ b/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.csproj @@ -1,8 +1,8 @@ + Exe 0 true - true true true diff --git a/src/tests/nativeaot/SmokeTests/Reflection/Reflection_FromUsage.csproj b/src/tests/nativeaot/SmokeTests/Reflection/Reflection_FromUsage.csproj index 23498fce304cc6..c569fde4d4cd9f 100644 --- a/src/tests/nativeaot/SmokeTests/Reflection/Reflection_FromUsage.csproj +++ b/src/tests/nativeaot/SmokeTests/Reflection/Reflection_FromUsage.csproj @@ -1,8 +1,8 @@ + Exe 0 true - true $(DefineConstants);REFLECTION_FROM_USAGE diff --git a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs index a95f1ae4628eef..19bff10ee7f489 100644 --- a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs +++ b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs @@ -3,13 +3,11 @@ using System; using System.Runtime.CompilerServices; -using Xunit; -public class Program +class Program { [MethodImpl(MethodImplOptions.NoInlining)] - [Fact] - public static int TestEntryPoint() + static int Main() { string stackTrace = Environment.StackTrace; @@ -20,7 +18,7 @@ public static int TestEntryPoint() #else const bool expected = true; #endif - bool actual = stackTrace.Contains(nameof(TestEntryPoint)) && stackTrace.Contains(nameof(Program)); + bool actual = stackTrace.Contains(nameof(Main)) && stackTrace.Contains(nameof(Program)); return expected == actual ? 100 : 1; } diff --git a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.csproj b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.csproj index 9c197384c4bae0..ad170f1dda90ed 100644 --- a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.csproj +++ b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.csproj @@ -1,9 +1,9 @@ + Exe 0 true true - true true true diff --git a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata_Stripped.csproj b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata_Stripped.csproj index dbdf581d8e678d..f825042a895bea 100644 --- a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata_Stripped.csproj +++ b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata_Stripped.csproj @@ -1,9 +1,9 @@ + Exe 0 true true - true true true diff --git a/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/Main.cs b/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/Main.cs index 83e0af14013d61..7a46f41961da19 100644 --- a/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/Main.cs +++ b/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/Main.cs @@ -3,35 +3,28 @@ using System; using System.Runtime.CompilerServices; -using Xunit; -public class Program +bool success = RunTest(Dataflow.Run); +success &= RunTest(DeadCodeElimination.Run); +success &= RunTest(FeatureSwitches.Run); +success &= RunTest(ILLinkDescriptor.Run); +success &= RunTest(DependencyInjectionPattern.Run); + +return success ? 100 : 1; + +static bool RunTest(Func t, [CallerArgumentExpression("t")] string name = null) { - [Fact] - public static int TestEntryPoint() + Console.WriteLine($"===== Running test {name} ====="); + bool success = true; + try { - bool success = RunTest(Dataflow.Run); - success &= RunTest(DeadCodeElimination.Run); - success &= RunTest(FeatureSwitches.Run); - success &= RunTest(ILLinkDescriptor.Run); - success &= RunTest(DependencyInjectionPattern.Run); - return success ? 100 : 1; + success = t() == 100; } - - static bool RunTest(Func t, [CallerArgumentExpression("t")] string name = null) + catch (Exception ex) { - Console.WriteLine($"===== Running test {name} ====="); - bool success = true; - try - { - success = t() == 100; - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - success = false; - } - Console.WriteLine($"===== Test {name} {(success ? "succeeded" : "failed")} ====="); - return success; + Console.WriteLine(ex.ToString()); + success = false; } + Console.WriteLine($"===== Test {name} {(success ? "succeeded" : "failed")} ====="); + return success; } diff --git a/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/TrimmingBehaviors.csproj b/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/TrimmingBehaviors.csproj index feef43d9c94169..fa0c9d0e4d7b2b 100644 --- a/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/TrimmingBehaviors.csproj +++ b/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/TrimmingBehaviors.csproj @@ -1,9 +1,9 @@ + Exe 0 true false - true true diff --git a/src/tests/nativeaot/SmokeTests/UnitTests/Main.cs b/src/tests/nativeaot/SmokeTests/UnitTests/Main.cs index fbed5e769a0f8c..e91a219dc4f527 100644 --- a/src/tests/nativeaot/SmokeTests/UnitTests/Main.cs +++ b/src/tests/nativeaot/SmokeTests/UnitTests/Main.cs @@ -3,37 +3,30 @@ using System; using System.Runtime.CompilerServices; -using Xunit; -public class Program +bool success = RunTest(BasicThreading.Run); +success &= RunTest(Delegates.Run); +success &= RunTest(Generics.Run); +success &= RunTest(Interfaces.Run); +success &= RunTest(Threading.Run); +success &= RunTest(Devirtualization.Run); +success &= RunTest(StackTraces.Run); + +return success ? 100 : 1; + +static bool RunTest(Func t, [CallerArgumentExpression("t")] string name = null) { - [Fact] - public static int TestEntryPoint() + Console.WriteLine($"===== Running test {name} ====="); + bool success = true; + try { - bool success = RunTest(BasicThreading.Run); - success &= RunTest(Delegates.Run); - success &= RunTest(Generics.Run); - success &= RunTest(Interfaces.Run); - success &= RunTest(Threading.Run); - success &= RunTest(Devirtualization.Run); - success &= RunTest(StackTraces.Run); - return success ? 100 : 1; + success = t() == 100; } - - static bool RunTest(Func t, [CallerArgumentExpression("t")] string name = null) + catch (Exception ex) { - Console.WriteLine($"===== Running test {name} ====="); - bool success = true; - try - { - success = t() == 100; - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - success = false; - } - Console.WriteLine($"===== Test {name} {(success ? "succeeded" : "failed")} ====="); - return success; + Console.WriteLine(ex.ToString()); + success = false; } + Console.WriteLine($"===== Test {name} {(success ? "succeeded" : "failed")} ====="); + return success; } diff --git a/src/tests/nativeaot/SmokeTests/UnitTests/UnitTests.csproj b/src/tests/nativeaot/SmokeTests/UnitTests/UnitTests.csproj index 3a49e588fb7bd0..d61a6236b1f07a 100644 --- a/src/tests/nativeaot/SmokeTests/UnitTests/UnitTests.csproj +++ b/src/tests/nativeaot/SmokeTests/UnitTests/UnitTests.csproj @@ -1,14 +1,14 @@ + Exe 0 true - true true $(NoWarn);IL3050;IL3054 - + diff --git a/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs b/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs index 73b8f204fcd090..1dfc7a8424792f 100644 --- a/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs +++ b/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs @@ -3,25 +3,20 @@ using System; using System.Runtime.InteropServices; -using Xunit; -public unsafe class Program +unsafe { - [Fact] - public static int TestEntryPoint() - { - nint lib = 0; + nint lib = 0; - if (GetIntValueFromResource(lib, (ushort*)(nuint)(ushort)10, 0x041B) != 3) - throw new Exception(); + if (GetIntValueFromResource(lib, (ushort*)(nuint)(ushort)10, 0x041B) != 3) + throw new Exception(); - ReadOnlySpan resName = "funny"; - fixed (char* pResName = resName) - if (GetIntValueFromResource(lib, (ushort*)pResName, 0x041B) != 1) - throw new Exception(); + ReadOnlySpan resName = "funny"; + fixed (char* pResName = resName) + if (GetIntValueFromResource(lib, (ushort*)pResName, 0x041B) != 1) + throw new Exception(); - return 100; - } + return 100; static int GetIntValueFromResource(nint hModule, ushort* lpName, ushort wLanguage) { diff --git a/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.csproj b/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.csproj index 82fb7430013b92..2fbfd993e96942 100644 --- a/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.csproj +++ b/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.csproj @@ -1,8 +1,8 @@ + Exe 0 true - true true test.res diff --git a/src/tests/nativeaot/StartupHook/StartupHook.cs b/src/tests/nativeaot/StartupHook/StartupHook.cs index 6ecb6405e81ec5..ed85bdb0604213 100644 --- a/src/tests/nativeaot/StartupHook/StartupHook.cs +++ b/src/tests/nativeaot/StartupHook/StartupHook.cs @@ -3,18 +3,13 @@ using System; using System.Diagnostics.CodeAnalysis; -using Xunit; -public class Program +class Program { internal static int s_return; [DynamicDependency(nameof(StartupHook.Initialize), typeof(StartupHook))] - [Fact] - public static int TestEntryPoint() - { - return s_return; - } + static int Main() => s_return; } class StartupHook diff --git a/src/tests/nativeaot/StartupHook/StartupHook.csproj b/src/tests/nativeaot/StartupHook/StartupHook.csproj index 38469401344b2c..f6b9b2ae9af15e 100644 --- a/src/tests/nativeaot/StartupHook/StartupHook.csproj +++ b/src/tests/nativeaot/StartupHook/StartupHook.csproj @@ -1,16 +1,16 @@ + Exe 0 true true $(NoWarn);IL2026 - - - true - + + + diff --git a/src/tests/sizeondisk/Directory.Build.props b/src/tests/sizeondisk/Directory.Build.props new file mode 100644 index 00000000000000..6c6181ee1b342b --- /dev/null +++ b/src/tests/sizeondisk/Directory.Build.props @@ -0,0 +1,7 @@ + + + + + $(TestSourceDir)performance/obj/project.assets.json + + diff --git a/src/tests/sizeondisk/sodbench/SoDBench.cs b/src/tests/sizeondisk/sodbench/SoDBench.cs new file mode 100644 index 00000000000000..10c916f09bd837 --- /dev/null +++ b/src/tests/sizeondisk/sodbench/SoDBench.cs @@ -0,0 +1,754 @@ +using CommandLine; +using CommandLine.Text; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; + +namespace SoDBench +{ + // A simple tree node for tracking file and directory names and sizes + // Does not have to accurately represent the true file system; only what we care about + class SizeReportingNode + { + public SizeReportingNode(string name, long? size=null, bool expand=true) + { + Name = name; + _size = size; + Expanded = expand; + } + + public SizeReportingNode(FileInfo file, bool expand=true) + { + Name = file.Name; + _size = file.Length; + Expanded = expand; + } + + // Builds out the tree starting from a directory + public SizeReportingNode(DirectoryInfo dir, int? reportingDepth=null) + { + Name = dir.Name; + + foreach (var childDir in dir.EnumerateDirectories()) + { + AddChild(new SizeReportingNode(childDir)); + } + + foreach (var childFile in dir.EnumerateFiles()) + { + AddChild(new SizeReportingNode(childFile)); + } + + if (reportingDepth != null) + { + LimitReportingDepth(reportingDepth ?? 0); + } + } + + + // The directory containing this node + public SizeReportingNode Parent { get; set; } + + // All the directories and files this node contains + public List Children {get; private set;} = new List(); + + // The file or directory name + public string Name { get; set; } + + public bool Expanded { get; set; } = true; + + // A list version of the path up to the root level we care about + public List SegmentedPath { + get + { + if (Parent != null) + { + var path = Parent.SegmentedPath; + path.Add(Name); + return path; + } + return new List { Name }; + } + } + + // The size of the file or directory + public long Size { + get + { + if (_size == null) + { + _size = 0; + foreach (var node in Children) + { + _size += node.Size; + } + } + return _size ?? 0; + } + + private set + { + _size = value; + } + } + + + // Add the adoptee node as a child and set the adoptee's parent + public void AddChild(SizeReportingNode adoptee) + { + Children.Add(adoptee); + adoptee.Parent = this; + _size = null; + } + + public void LimitReportingDepth(int depth) + { + if (depth <= 0) + { + Expanded = false; + } + + foreach (var childNode in Children) + { + childNode.LimitReportingDepth(depth-1); + } + } + + // Return a CSV formatted string representation of the tree + public string FormatAsCsv() + { + return FormatAsCsv(new StringBuilder()).ToString(); + } + + // Add to the string build a csv formatted representation of the tree + public StringBuilder FormatAsCsv(StringBuilder builder) + { + string path = String.Join(",", SegmentedPath.Select(s => Csv.Escape(s))); + builder.AppendLine($"{path},{Size}"); + + if (Expanded) + { + foreach (var childNode in Children) + { + childNode.FormatAsCsv(builder); + } + } + + return builder; + } + + private long? _size = null; + } + + class Program + { + public static readonly string NugetConfig = + @" + + + + + + "; + + public static readonly string[] NewTemplates = new string[] { + "console", + "classlib", + "mstest", + "xunit", + "web", + "mvc", + "razor", + "webapi", + "nugetconfig", + "webconfig", + "sln", + "page", + "viewimports", + "viewstart" + }; + + public static readonly string[] OperatingSystems = new string[] { + "win10-x64", + "win10-x86", + "ubuntu.16.10-x64", + "rhel.7-x64" + }; + + static FileInfo s_dotnetExe; + static DirectoryInfo s_sandboxDir; + static DirectoryInfo s_fallbackDir; + static DirectoryInfo s_corelibsDir; + static bool s_keepArtifacts; + static string s_targetArchitecture; + static string s_dotnetChannel; + + static void Main(string[] args) + { + try + { + var options = SoDBenchOptions.Parse(args); + + s_targetArchitecture = options.TargetArchitecture; + s_dotnetChannel = options.DotnetChannel; + s_keepArtifacts = options.KeepArtifacts; + + if (!String.IsNullOrWhiteSpace(options.DotnetExecutable)) + { + s_dotnetExe = new FileInfo(options.DotnetExecutable); + } + + if (s_sandboxDir == null) + { + // Truncate the Guid used for anti-collision because a full Guid results in expanded paths over 260 chars (the Windows max) + s_sandboxDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), $"sod{Guid.NewGuid().ToString().Substring(0,13)}")); + s_sandboxDir.Create(); + Console.WriteLine($"** Running inside sandbox directory: {s_sandboxDir}"); + } + + if (s_dotnetExe == null) + { + if(!String.IsNullOrEmpty(options.CoreLibrariesDirectory)) + { + Console.WriteLine($"** Using core libraries found at {options.CoreLibrariesDirectory}"); + s_corelibsDir = new DirectoryInfo(options.CoreLibrariesDirectory); + } + else + { + var coreroot = Environment.GetEnvironmentVariable("CORE_ROOT"); + if (!String.IsNullOrEmpty(coreroot) && Directory.Exists(coreroot)) + { + Console.WriteLine($"** Using core libraries from CORE_ROOT at {coreroot}"); + s_corelibsDir = new DirectoryInfo(coreroot); + } + else + { + Console.WriteLine("** Using default dotnet-cli core libraries"); + } + } + + PrintHeader("** Installing Dotnet CLI"); + s_dotnetExe = SetupDotnet(); + } + + if (s_fallbackDir == null) + { + s_fallbackDir = new DirectoryInfo(Path.Combine(s_sandboxDir.FullName, "fallback")); + s_fallbackDir.Create(); + } + + Console.WriteLine($"** Path to dotnet executable: {s_dotnetExe.FullName}"); + + PrintHeader("** Starting acquisition size test"); + var acquisition = GetAcquisitionSize(); + + PrintHeader("** Running deployment size test"); + var deployment = GetDeploymentSize(); + + var root = new SizeReportingNode("Dotnet Total"); + root.AddChild(acquisition); + root.AddChild(deployment); + + var formattedStr = root.FormatAsCsv(); + + File.WriteAllText(options.OutputFilename, formattedStr); + + if (options.Verbose) + Console.WriteLine($"** CSV Output:\n{formattedStr}"); + } + finally + { + if (!s_keepArtifacts && s_sandboxDir != null) + { + PrintHeader("** Cleaning up sandbox directory"); + DeleteDirectory(s_sandboxDir); + s_sandboxDir = null; + } + } + } + + private static void PrintHeader(string message) + { + Console.WriteLine(); + Console.WriteLine("**********************************************************************"); + Console.WriteLine($"** {message}"); + Console.WriteLine("**********************************************************************"); + } + + private static SizeReportingNode GetAcquisitionSize() + { + var result = new SizeReportingNode("Acquisition Size"); + + // Arbitrary command to trigger first time setup + ProcessStartInfo dotnet = new ProcessStartInfo() + { + WorkingDirectory = s_sandboxDir.FullName, + FileName = s_dotnetExe.FullName, + Arguments = "new" + }; + + // Used to set where the packages will be unpacked to. + // There is a no guarantee that this is a stable method, but is the only way currently to set the fallback folder location + dotnet.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = s_fallbackDir.FullName; + + LaunchProcess(dotnet, 180000); + + Console.WriteLine("\n** Measuring total size of acquired files"); + + result.AddChild(new SizeReportingNode(s_fallbackDir, 1)); + + var dotnetNode = new SizeReportingNode(s_dotnetExe.Directory); + var reportingDepths = new Dictionary + { + {"additionalDeps", 1}, + {"host", 0}, + {"sdk", 2}, + {"shared", 2}, + {"store", 3} + }; + foreach (var childNode in dotnetNode.Children) + { + int depth = 0; + if (reportingDepths.TryGetValue(childNode.Name, out depth)) + { + childNode.LimitReportingDepth(depth); + } + } + result.AddChild(dotnetNode); + + return result; + } + + private static SizeReportingNode GetDeploymentSize() + { + // Write the NuGet.Config file + var nugetConfFile = new FileInfo(Path.Combine(s_sandboxDir.FullName, "NuGet.Config")); + File.WriteAllText(nugetConfFile.FullName, NugetConfig); + + var result = new SizeReportingNode("Deployment Size"); + foreach (string template in NewTemplates) + { + var templateNode = new SizeReportingNode(template); + result.AddChild(templateNode); + + foreach (var os in OperatingSystems) + { + Console.WriteLine($"\n\n** Deploying {template}/{os}"); + + var deploymentSandbox = new DirectoryInfo(Path.Combine(s_sandboxDir.FullName, template, os)); + var publishDir = new DirectoryInfo(Path.Combine(deploymentSandbox.FullName, "publish")); + deploymentSandbox.Create(); + + ProcessStartInfo dotnetNew = new ProcessStartInfo() + { + FileName = s_dotnetExe.FullName, + Arguments = $"new {template}", + UseShellExecute = false, + WorkingDirectory = deploymentSandbox.FullName + }; + dotnetNew.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = s_fallbackDir.FullName; + + ProcessStartInfo dotnetRestore = new ProcessStartInfo() + { + FileName = s_dotnetExe.FullName, + Arguments = $"restore --runtime {os}", + UseShellExecute = false, + WorkingDirectory = deploymentSandbox.FullName + }; + dotnetRestore.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = s_fallbackDir.FullName; + + ProcessStartInfo dotnetPublish = new ProcessStartInfo() + { + FileName = s_dotnetExe.FullName, + // The UserSharedCompiler flag is set to false to prevent handles from being held that will later cause deletion of the installed SDK to fail. + Arguments = $"publish -c Release --runtime {os} --output {publishDir.FullName} /p:UseSharedCompilation=false /p:UseRazorBuildServer=false", + UseShellExecute = false, + WorkingDirectory = deploymentSandbox.FullName + }; + dotnetPublish.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = s_fallbackDir.FullName; + + try + { + LaunchProcess(dotnetNew, 180000); + if (deploymentSandbox.EnumerateFiles().Any(f => f.Name.EndsWith("proj"))) + { + LaunchProcess(dotnetRestore, 180000); + LaunchProcess(dotnetPublish, 180000); + } + else + { + Console.WriteLine($"** {template} does not have a project file to restore or publish"); + } + } + catch (Exception e) + { + Console.Error.WriteLine(e.Message); + continue; + } + + // If we published this project, only report it's published size + if (publishDir.Exists) + { + var publishNode = new SizeReportingNode(publishDir, 0); + publishNode.Name = deploymentSandbox.Name; + templateNode.AddChild(publishNode); + + if (publishNode.Size <= 0) { + throw new InvalidOperationException($"{publishNode.Name} reports as invalid size {publishNode.Size}"); + } + } + else + { + templateNode.AddChild(new SizeReportingNode(deploymentSandbox, 0)); + } + } + } + return result; + } + + private static void DownloadDotnetInstaller() + { + var psi = new ProcessStartInfo() { + WorkingDirectory = s_sandboxDir.FullName, + FileName = @"powershell.exe", + Arguments = $"-NoProfile wget https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1 -OutFile Dotnet-Install.ps1" + }; + LaunchProcess(psi, 180000); + } + + private static void InstallSharedRuntime() + { + var psi = new ProcessStartInfo() { + WorkingDirectory = s_sandboxDir.FullName, + FileName = @"powershell.exe", + Arguments = $"-NoProfile -ExecutionPolicy Bypass -File .\\Dotnet-Install.ps1 -Runtime dotnet -InstallDir .dotnet -Channel {s_dotnetChannel} -Architecture {s_targetArchitecture}" + }; + LaunchProcess(psi, 180000); + } + + private static void InstallDotnet() + { + var psi = new ProcessStartInfo() { + WorkingDirectory = s_sandboxDir.FullName, + FileName = @"powershell.exe", + Arguments = $"-NoProfile -ExecutionPolicy Bypass -File .\\Dotnet-Install.ps1 -InstallDir .dotnet -Channel {s_dotnetChannel} -Architecture {s_targetArchitecture}" + }; + LaunchProcess(psi, 180000); + } + + private static void ModifySharedFramework() + { + // Current working directory is the /sandbox directory. + Console.WriteLine($"** Modifying the shared framework."); + + var sourcedi = s_corelibsDir; + + // Get the directory containing the newest version of Microsodt.NETCore.App libraries + var targetdi = new DirectoryInfo( + new DirectoryInfo(Path.Combine(s_sandboxDir.FullName, ".dotnet", "shared", "Microsoft.NETCore.App")) + .GetDirectories("*") + .OrderBy(s => s.Name) + .Last() + .FullName); + + Console.WriteLine($"| Source : {sourcedi.FullName}"); + Console.WriteLine($"| Target : {targetdi.FullName}"); + + var compiledBinariesOfInterest = new string[] { + "clretwrc.dll", + "clrjit.dll", + "coreclr.dll", + "mscordaccore.dll", + "mscordbi.dll", + "mscorrc.dll", + "sos.dll", + "SOS.NETCore.dll", + "System.Private.CoreLib.dll" + }; + + foreach (var compiledBinaryOfInterest in compiledBinariesOfInterest) + { + foreach (FileInfo fi in targetdi.GetFiles(compiledBinaryOfInterest)) + { + var sourceFilePath = Path.Combine(sourcedi.FullName, fi.Name); + var targetFilePath = Path.Combine(targetdi.FullName, fi.Name); + + if (File.Exists(sourceFilePath)) + { + File.Copy(sourceFilePath, targetFilePath, true); + Console.WriteLine($"| Copied file - '{fi.Name}'"); + } + } + } + } + + private static FileInfo SetupDotnet() + { + DownloadDotnetInstaller(); + InstallSharedRuntime(); + InstallDotnet(); + if (s_corelibsDir != null) + { + ModifySharedFramework(); + } + + var dotnetExe = new FileInfo(Path.Combine(s_sandboxDir.FullName, ".dotnet", "dotnet.exe")); + Debug.Assert(dotnetExe.Exists); + + return dotnetExe; + } + + private static void LaunchProcess(ProcessStartInfo processStartInfo, int timeoutMilliseconds, IDictionary environment = null) + { + Console.WriteLine(); + Console.WriteLine($"{System.Security.Principal.WindowsIdentity.GetCurrent().Name}@{Environment.MachineName} \"{processStartInfo.WorkingDirectory}\""); + Console.WriteLine($"[{DateTime.Now}] $ {processStartInfo.FileName} {processStartInfo.Arguments}"); + + if (environment != null) + { + foreach (KeyValuePair pair in environment) + { + if (!processStartInfo.Environment.ContainsKey(pair.Key)) + processStartInfo.Environment.Add(pair.Key, pair.Value); + else + processStartInfo.Environment[pair.Key] = pair.Value; + } + } + + using (var p = new Process() { StartInfo = processStartInfo }) + { + p.Start(); + if (p.WaitForExit(timeoutMilliseconds) == false) + { + // FIXME: What about clean/kill child processes? + p.Kill(); + throw new TimeoutException($"The process '{processStartInfo.FileName} {processStartInfo.Arguments}' timed out."); + } + + if (p.ExitCode != 0) + throw new Exception($"{processStartInfo.FileName} exited with error code {p.ExitCode}"); + } + } + + /// + /// Provides an interface to parse the command line arguments passed to the SoDBench. + /// + private sealed class SoDBenchOptions + { + public SoDBenchOptions() { } + + private static string NormalizePath(string path) + { + if (String.IsNullOrWhiteSpace(path)) + throw new InvalidOperationException($"'{path}' is an invalid path: cannot be null or whitespace"); + + if (path.Any(c => Path.GetInvalidPathChars().Contains(c))) + throw new InvalidOperationException($"'{path}' is an invalid path: contains invalid characters"); + + return Path.IsPathRooted(path) ? path : Path.GetFullPath(path); + } + + [Option('o', Required = false, HelpText = "Specifies the output file name for the csv document")] + public string OutputFilename + { + get { return _outputFilename; } + + set + { + _outputFilename = NormalizePath(value); + } + } + + [Option("dotnet", Required = false, HelpText = "Specifies the location of dotnet cli to use.")] + public string DotnetExecutable + { + get { return _dotnetExe; } + + set + { + _dotnetExe = NormalizePath(value); + } + } + + [Option("corelibs", Required = false, HelpText = "Specifies the location of .NET Core libraries to patch into dotnet. Cannot be used with --dotnet")] + public string CoreLibrariesDirectory + { + get { return _corelibsDir; } + + set + { + _corelibsDir = NormalizePath(value); + } + } + + [Option("architecture", Required = false, Default = "x64", HelpText = "JitBench target architecture (It must match the built product that was copied into sandbox).")] + public string TargetArchitecture { get; set; } + + [Option("channel", Required = false, Default = "master", HelpText = "Specifies the channel to use when installing the dotnet-cli")] + public string DotnetChannel { get; set; } + + [Option('v', Required = false, HelpText = "Sets output to verbose")] + public bool Verbose { get; set; } + + [Option("keep-artifacts", Required = false, HelpText = "Specifies that artifacts of this run should be kept")] + public bool KeepArtifacts { get; set; } + + public static SoDBenchOptions Parse(string[] args) + { + using (var parser = new Parser((settings) => { + settings.CaseInsensitiveEnumValues = true; + settings.CaseSensitive = false; + settings.HelpWriter = new StringWriter(); + settings.IgnoreUnknownArguments = true; + })) + { + SoDBenchOptions options = null; + parser.ParseArguments(args) + .WithParsed(parsed => options = parsed) + .WithNotParsed(errors => { + foreach (Error error in errors) + { + switch (error.Tag) + { + case ErrorType.MissingValueOptionError: + throw new ArgumentException( + $"Missing value option for command line argument '{(error as MissingValueOptionError).NameInfo.NameText}'"); + case ErrorType.HelpRequestedError: + Console.WriteLine(Usage()); + Environment.Exit(0); + break; + case ErrorType.VersionRequestedError: + Console.WriteLine(new AssemblyName(typeof(SoDBenchOptions).GetTypeInfo().Assembly.FullName).Version); + Environment.Exit(0); + break; + case ErrorType.BadFormatTokenError: + case ErrorType.UnknownOptionError: + case ErrorType.MissingRequiredOptionError: + case ErrorType.MutuallyExclusiveSetError: + case ErrorType.BadFormatConversionError: + case ErrorType.SequenceOutOfRangeError: + case ErrorType.RepeatedOptionError: + case ErrorType.NoVerbSelectedError: + case ErrorType.BadVerbSelectedError: + case ErrorType.HelpVerbRequestedError: + break; + } + } + }); + + if (options != null && !String.IsNullOrEmpty(options.DotnetExecutable) && !String.IsNullOrEmpty(options.CoreLibrariesDirectory)) + { + throw new ArgumentException("--dotnet and --corlibs cannot be used together"); + } + + return options; + } + } + + public static string Usage() + { + var parser = new Parser((parserSettings) => + { + parserSettings.CaseInsensitiveEnumValues = true; + parserSettings.CaseSensitive = false; + parserSettings.EnableDashDash = true; + parserSettings.HelpWriter = new StringWriter(); + parserSettings.IgnoreUnknownArguments = true; + }); + + var helpTextString = new HelpText + { + AddDashesToOption = true, + AddEnumValuesToHelpText = true, + AdditionalNewLineAfterOption = false, + Heading = "SoDBench", + MaximumDisplayWidth = 80, + }.AddOptions(parser.ParseArguments(new string[] { "--help" })).ToString(); + return helpTextString; + } + + private string _dotnetExe; + private string _corelibsDir; + private string _outputFilename = "measurement.csv"; + } + + private static void DeleteDirectory(DirectoryInfo dir, uint maxWait=10000) + { + foreach (var subdir in dir.GetDirectories()) + { + DeleteDirectory(subdir); + } + + // Give it time to actually delete all the files + var files = dir.GetFiles(); + bool wait = true; + uint waitTime = 0; + while (wait) + { + wait = false; + + foreach (var f in files) + { + if (File.Exists(f.FullName)) + { + try + { + File.Delete(f.FullName); + } + catch (IOException) { if (waitTime > maxWait) throw; } + catch (UnauthorizedAccessException) { if (waitTime > maxWait) throw; } + + if (File.Exists(f.FullName)) + { + wait = true; + + // Print a message every 3 seconds if the thread is stuck + if (waitTime != 0 && waitTime % 3000 == 0) + { + Console.WriteLine($"Waiting to delete {f.FullName}"); + } + } + } + } + + // Try again in 100ms + if (wait) + { + Thread.Sleep(100); + waitTime += 100; + } + } + + Directory.Delete(dir.FullName); + } + } + + // A simple class for escaping strings for CSV writing + // https://stackoverflow.com/a/769713 + // Used instead of a package because only these < 20 lines of code are needed + public static class Csv + { + public static string Escape( string s ) + { + if ( s.Contains( QUOTE ) ) + s = s.Replace( QUOTE, ESCAPED_QUOTE ); + + if ( s.IndexOfAny( CHARACTERS_THAT_MUST_BE_QUOTED ) > -1 ) + s = QUOTE + s + QUOTE; + + return s; + } + + private const string QUOTE = "\""; + private const string ESCAPED_QUOTE = "\"\""; + private static char[] CHARACTERS_THAT_MUST_BE_QUOTED = { ',', '"', '\n' }; + } +} diff --git a/src/tests/sizeondisk/sodbench/SoDBench.csproj b/src/tests/sizeondisk/sodbench/SoDBench.csproj new file mode 100644 index 00000000000000..6b63b65f0eb430 --- /dev/null +++ b/src/tests/sizeondisk/sodbench/SoDBench.csproj @@ -0,0 +1,11 @@ + + + exe + BuildOnly + pdbonly + true + + + + + diff --git a/src/tests/sizeondisk/sodbench/THIRD-PARTY-NOTICES.TXT b/src/tests/sizeondisk/sodbench/THIRD-PARTY-NOTICES.TXT new file mode 100644 index 00000000000000..6e029eec35798e --- /dev/null +++ b/src/tests/sizeondisk/sodbench/THIRD-PARTY-NOTICES.TXT @@ -0,0 +1,25 @@ +.NET uses third-party libraries or other resources that may be +distributed under licenses different than the .NET software. + +Attributions and license notices for test cases originally authored by +third parties can be found in the respective test directories. + +In the event that we accidentally failed to list a required notice, please +bring it to our attention. Post an issue or email us: + + dotnet@microsoft.com + +The attached notices are provided for information only. + +License notice for Stack Overflow +------------------------------------- + +Policy: https://stackoverflow.com/help/licensing +License: https://creativecommons.org/licenses/by-sa/3.0/ + +Title: Dealing with commas in a CSV file +Content: https://stackoverflow.com/a/769713 +Question author: Bob The Janitor -- https://stackoverflow.com/users/55102/bob-the-janitor +Answer author: harp -- https://stackoverflow.com/users/4525/harpo + +Use: https://github.com/dotnet/runtime/blob/4893732ba881a4fb9023af1d6d4e64bb2a6eddbc/src/tests/sizeondisk/sodbench/SoDBench.cs#L735 From 5d7a9ad29e78d11d2325ce49d6f15cc1a7a7e63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 26 Mar 2024 07:49:42 +0100 Subject: [PATCH 3/3] Keep the non-nativeaot changes --- src/tests/managed/Compilation/Compilation.cs | 22 +- .../managed/Compilation/Compilation.csproj | 2 +- src/tests/managed/Managed.csproj | 11 + src/tests/sizeondisk/Directory.Build.props | 7 - src/tests/sizeondisk/sodbench/SoDBench.cs | 754 ------------------ src/tests/sizeondisk/sodbench/SoDBench.csproj | 11 - .../sodbench/THIRD-PARTY-NOTICES.TXT | 25 - 7 files changed, 28 insertions(+), 804 deletions(-) create mode 100644 src/tests/managed/Managed.csproj delete mode 100644 src/tests/sizeondisk/Directory.Build.props delete mode 100644 src/tests/sizeondisk/sodbench/SoDBench.cs delete mode 100644 src/tests/sizeondisk/sodbench/SoDBench.csproj delete mode 100644 src/tests/sizeondisk/sodbench/THIRD-PARTY-NOTICES.TXT diff --git a/src/tests/managed/Compilation/Compilation.cs b/src/tests/managed/Compilation/Compilation.cs index 0b1e9d2cd9872f..4852618cea3ed0 100644 --- a/src/tests/managed/Compilation/Compilation.cs +++ b/src/tests/managed/Compilation/Compilation.cs @@ -8,24 +8,34 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using Xunit; -class Program +public class Program { - static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine("Starting the test"); string codeFile = @"HelloWorld.cs"; - var sourceTree = new List(){SyntaxFactory.ParseSyntaxTree(File.ReadAllText(codeFile))}; + var sourceTree = new List() + { + SyntaxFactory.ParseSyntaxTree(File.ReadAllText(codeFile)) + }; + + string mscorlibFile = Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), + "System.Private.CoreLib.dll"); - string mscorlibFile = Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), "System.Private.CoreLib.dll"); Console.WriteLine("Using reference to: {0}", mscorlibFile); - var reference = new List(){ MetadataReference.CreateFromFile(mscorlibFile)}; + var reference = new List() + { + MetadataReference.CreateFromFile(mscorlibFile) + }; var compilation = CSharpCompilation.Create("helloworld", sourceTree, reference); - Console.WriteLine("Test compiled"); var result = compilation.Emit(new FileStream("helloworld.exe", FileMode.Create)); + if (!result.Success) { return -1; diff --git a/src/tests/managed/Compilation/Compilation.csproj b/src/tests/managed/Compilation/Compilation.csproj index f6521d8ff2df4b..ecd42497008239 100644 --- a/src/tests/managed/Compilation/Compilation.csproj +++ b/src/tests/managed/Compilation/Compilation.csproj @@ -1,6 +1,6 @@ - Exe + true true true diff --git a/src/tests/managed/Managed.csproj b/src/tests/managed/Managed.csproj new file mode 100644 index 00000000000000..305a3dfa0b613b --- /dev/null +++ b/src/tests/managed/Managed.csproj @@ -0,0 +1,11 @@ + + + + + + + false + + + + diff --git a/src/tests/sizeondisk/Directory.Build.props b/src/tests/sizeondisk/Directory.Build.props deleted file mode 100644 index 6c6181ee1b342b..00000000000000 --- a/src/tests/sizeondisk/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - $(TestSourceDir)performance/obj/project.assets.json - - diff --git a/src/tests/sizeondisk/sodbench/SoDBench.cs b/src/tests/sizeondisk/sodbench/SoDBench.cs deleted file mode 100644 index 10c916f09bd837..00000000000000 --- a/src/tests/sizeondisk/sodbench/SoDBench.cs +++ /dev/null @@ -1,754 +0,0 @@ -using CommandLine; -using CommandLine.Text; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Reflection; -using System.Threading; -using System.Threading.Tasks; - -namespace SoDBench -{ - // A simple tree node for tracking file and directory names and sizes - // Does not have to accurately represent the true file system; only what we care about - class SizeReportingNode - { - public SizeReportingNode(string name, long? size=null, bool expand=true) - { - Name = name; - _size = size; - Expanded = expand; - } - - public SizeReportingNode(FileInfo file, bool expand=true) - { - Name = file.Name; - _size = file.Length; - Expanded = expand; - } - - // Builds out the tree starting from a directory - public SizeReportingNode(DirectoryInfo dir, int? reportingDepth=null) - { - Name = dir.Name; - - foreach (var childDir in dir.EnumerateDirectories()) - { - AddChild(new SizeReportingNode(childDir)); - } - - foreach (var childFile in dir.EnumerateFiles()) - { - AddChild(new SizeReportingNode(childFile)); - } - - if (reportingDepth != null) - { - LimitReportingDepth(reportingDepth ?? 0); - } - } - - - // The directory containing this node - public SizeReportingNode Parent { get; set; } - - // All the directories and files this node contains - public List Children {get; private set;} = new List(); - - // The file or directory name - public string Name { get; set; } - - public bool Expanded { get; set; } = true; - - // A list version of the path up to the root level we care about - public List SegmentedPath { - get - { - if (Parent != null) - { - var path = Parent.SegmentedPath; - path.Add(Name); - return path; - } - return new List { Name }; - } - } - - // The size of the file or directory - public long Size { - get - { - if (_size == null) - { - _size = 0; - foreach (var node in Children) - { - _size += node.Size; - } - } - return _size ?? 0; - } - - private set - { - _size = value; - } - } - - - // Add the adoptee node as a child and set the adoptee's parent - public void AddChild(SizeReportingNode adoptee) - { - Children.Add(adoptee); - adoptee.Parent = this; - _size = null; - } - - public void LimitReportingDepth(int depth) - { - if (depth <= 0) - { - Expanded = false; - } - - foreach (var childNode in Children) - { - childNode.LimitReportingDepth(depth-1); - } - } - - // Return a CSV formatted string representation of the tree - public string FormatAsCsv() - { - return FormatAsCsv(new StringBuilder()).ToString(); - } - - // Add to the string build a csv formatted representation of the tree - public StringBuilder FormatAsCsv(StringBuilder builder) - { - string path = String.Join(",", SegmentedPath.Select(s => Csv.Escape(s))); - builder.AppendLine($"{path},{Size}"); - - if (Expanded) - { - foreach (var childNode in Children) - { - childNode.FormatAsCsv(builder); - } - } - - return builder; - } - - private long? _size = null; - } - - class Program - { - public static readonly string NugetConfig = - @" - - - - - - "; - - public static readonly string[] NewTemplates = new string[] { - "console", - "classlib", - "mstest", - "xunit", - "web", - "mvc", - "razor", - "webapi", - "nugetconfig", - "webconfig", - "sln", - "page", - "viewimports", - "viewstart" - }; - - public static readonly string[] OperatingSystems = new string[] { - "win10-x64", - "win10-x86", - "ubuntu.16.10-x64", - "rhel.7-x64" - }; - - static FileInfo s_dotnetExe; - static DirectoryInfo s_sandboxDir; - static DirectoryInfo s_fallbackDir; - static DirectoryInfo s_corelibsDir; - static bool s_keepArtifacts; - static string s_targetArchitecture; - static string s_dotnetChannel; - - static void Main(string[] args) - { - try - { - var options = SoDBenchOptions.Parse(args); - - s_targetArchitecture = options.TargetArchitecture; - s_dotnetChannel = options.DotnetChannel; - s_keepArtifacts = options.KeepArtifacts; - - if (!String.IsNullOrWhiteSpace(options.DotnetExecutable)) - { - s_dotnetExe = new FileInfo(options.DotnetExecutable); - } - - if (s_sandboxDir == null) - { - // Truncate the Guid used for anti-collision because a full Guid results in expanded paths over 260 chars (the Windows max) - s_sandboxDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), $"sod{Guid.NewGuid().ToString().Substring(0,13)}")); - s_sandboxDir.Create(); - Console.WriteLine($"** Running inside sandbox directory: {s_sandboxDir}"); - } - - if (s_dotnetExe == null) - { - if(!String.IsNullOrEmpty(options.CoreLibrariesDirectory)) - { - Console.WriteLine($"** Using core libraries found at {options.CoreLibrariesDirectory}"); - s_corelibsDir = new DirectoryInfo(options.CoreLibrariesDirectory); - } - else - { - var coreroot = Environment.GetEnvironmentVariable("CORE_ROOT"); - if (!String.IsNullOrEmpty(coreroot) && Directory.Exists(coreroot)) - { - Console.WriteLine($"** Using core libraries from CORE_ROOT at {coreroot}"); - s_corelibsDir = new DirectoryInfo(coreroot); - } - else - { - Console.WriteLine("** Using default dotnet-cli core libraries"); - } - } - - PrintHeader("** Installing Dotnet CLI"); - s_dotnetExe = SetupDotnet(); - } - - if (s_fallbackDir == null) - { - s_fallbackDir = new DirectoryInfo(Path.Combine(s_sandboxDir.FullName, "fallback")); - s_fallbackDir.Create(); - } - - Console.WriteLine($"** Path to dotnet executable: {s_dotnetExe.FullName}"); - - PrintHeader("** Starting acquisition size test"); - var acquisition = GetAcquisitionSize(); - - PrintHeader("** Running deployment size test"); - var deployment = GetDeploymentSize(); - - var root = new SizeReportingNode("Dotnet Total"); - root.AddChild(acquisition); - root.AddChild(deployment); - - var formattedStr = root.FormatAsCsv(); - - File.WriteAllText(options.OutputFilename, formattedStr); - - if (options.Verbose) - Console.WriteLine($"** CSV Output:\n{formattedStr}"); - } - finally - { - if (!s_keepArtifacts && s_sandboxDir != null) - { - PrintHeader("** Cleaning up sandbox directory"); - DeleteDirectory(s_sandboxDir); - s_sandboxDir = null; - } - } - } - - private static void PrintHeader(string message) - { - Console.WriteLine(); - Console.WriteLine("**********************************************************************"); - Console.WriteLine($"** {message}"); - Console.WriteLine("**********************************************************************"); - } - - private static SizeReportingNode GetAcquisitionSize() - { - var result = new SizeReportingNode("Acquisition Size"); - - // Arbitrary command to trigger first time setup - ProcessStartInfo dotnet = new ProcessStartInfo() - { - WorkingDirectory = s_sandboxDir.FullName, - FileName = s_dotnetExe.FullName, - Arguments = "new" - }; - - // Used to set where the packages will be unpacked to. - // There is a no guarantee that this is a stable method, but is the only way currently to set the fallback folder location - dotnet.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = s_fallbackDir.FullName; - - LaunchProcess(dotnet, 180000); - - Console.WriteLine("\n** Measuring total size of acquired files"); - - result.AddChild(new SizeReportingNode(s_fallbackDir, 1)); - - var dotnetNode = new SizeReportingNode(s_dotnetExe.Directory); - var reportingDepths = new Dictionary - { - {"additionalDeps", 1}, - {"host", 0}, - {"sdk", 2}, - {"shared", 2}, - {"store", 3} - }; - foreach (var childNode in dotnetNode.Children) - { - int depth = 0; - if (reportingDepths.TryGetValue(childNode.Name, out depth)) - { - childNode.LimitReportingDepth(depth); - } - } - result.AddChild(dotnetNode); - - return result; - } - - private static SizeReportingNode GetDeploymentSize() - { - // Write the NuGet.Config file - var nugetConfFile = new FileInfo(Path.Combine(s_sandboxDir.FullName, "NuGet.Config")); - File.WriteAllText(nugetConfFile.FullName, NugetConfig); - - var result = new SizeReportingNode("Deployment Size"); - foreach (string template in NewTemplates) - { - var templateNode = new SizeReportingNode(template); - result.AddChild(templateNode); - - foreach (var os in OperatingSystems) - { - Console.WriteLine($"\n\n** Deploying {template}/{os}"); - - var deploymentSandbox = new DirectoryInfo(Path.Combine(s_sandboxDir.FullName, template, os)); - var publishDir = new DirectoryInfo(Path.Combine(deploymentSandbox.FullName, "publish")); - deploymentSandbox.Create(); - - ProcessStartInfo dotnetNew = new ProcessStartInfo() - { - FileName = s_dotnetExe.FullName, - Arguments = $"new {template}", - UseShellExecute = false, - WorkingDirectory = deploymentSandbox.FullName - }; - dotnetNew.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = s_fallbackDir.FullName; - - ProcessStartInfo dotnetRestore = new ProcessStartInfo() - { - FileName = s_dotnetExe.FullName, - Arguments = $"restore --runtime {os}", - UseShellExecute = false, - WorkingDirectory = deploymentSandbox.FullName - }; - dotnetRestore.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = s_fallbackDir.FullName; - - ProcessStartInfo dotnetPublish = new ProcessStartInfo() - { - FileName = s_dotnetExe.FullName, - // The UserSharedCompiler flag is set to false to prevent handles from being held that will later cause deletion of the installed SDK to fail. - Arguments = $"publish -c Release --runtime {os} --output {publishDir.FullName} /p:UseSharedCompilation=false /p:UseRazorBuildServer=false", - UseShellExecute = false, - WorkingDirectory = deploymentSandbox.FullName - }; - dotnetPublish.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = s_fallbackDir.FullName; - - try - { - LaunchProcess(dotnetNew, 180000); - if (deploymentSandbox.EnumerateFiles().Any(f => f.Name.EndsWith("proj"))) - { - LaunchProcess(dotnetRestore, 180000); - LaunchProcess(dotnetPublish, 180000); - } - else - { - Console.WriteLine($"** {template} does not have a project file to restore or publish"); - } - } - catch (Exception e) - { - Console.Error.WriteLine(e.Message); - continue; - } - - // If we published this project, only report it's published size - if (publishDir.Exists) - { - var publishNode = new SizeReportingNode(publishDir, 0); - publishNode.Name = deploymentSandbox.Name; - templateNode.AddChild(publishNode); - - if (publishNode.Size <= 0) { - throw new InvalidOperationException($"{publishNode.Name} reports as invalid size {publishNode.Size}"); - } - } - else - { - templateNode.AddChild(new SizeReportingNode(deploymentSandbox, 0)); - } - } - } - return result; - } - - private static void DownloadDotnetInstaller() - { - var psi = new ProcessStartInfo() { - WorkingDirectory = s_sandboxDir.FullName, - FileName = @"powershell.exe", - Arguments = $"-NoProfile wget https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1 -OutFile Dotnet-Install.ps1" - }; - LaunchProcess(psi, 180000); - } - - private static void InstallSharedRuntime() - { - var psi = new ProcessStartInfo() { - WorkingDirectory = s_sandboxDir.FullName, - FileName = @"powershell.exe", - Arguments = $"-NoProfile -ExecutionPolicy Bypass -File .\\Dotnet-Install.ps1 -Runtime dotnet -InstallDir .dotnet -Channel {s_dotnetChannel} -Architecture {s_targetArchitecture}" - }; - LaunchProcess(psi, 180000); - } - - private static void InstallDotnet() - { - var psi = new ProcessStartInfo() { - WorkingDirectory = s_sandboxDir.FullName, - FileName = @"powershell.exe", - Arguments = $"-NoProfile -ExecutionPolicy Bypass -File .\\Dotnet-Install.ps1 -InstallDir .dotnet -Channel {s_dotnetChannel} -Architecture {s_targetArchitecture}" - }; - LaunchProcess(psi, 180000); - } - - private static void ModifySharedFramework() - { - // Current working directory is the /sandbox directory. - Console.WriteLine($"** Modifying the shared framework."); - - var sourcedi = s_corelibsDir; - - // Get the directory containing the newest version of Microsodt.NETCore.App libraries - var targetdi = new DirectoryInfo( - new DirectoryInfo(Path.Combine(s_sandboxDir.FullName, ".dotnet", "shared", "Microsoft.NETCore.App")) - .GetDirectories("*") - .OrderBy(s => s.Name) - .Last() - .FullName); - - Console.WriteLine($"| Source : {sourcedi.FullName}"); - Console.WriteLine($"| Target : {targetdi.FullName}"); - - var compiledBinariesOfInterest = new string[] { - "clretwrc.dll", - "clrjit.dll", - "coreclr.dll", - "mscordaccore.dll", - "mscordbi.dll", - "mscorrc.dll", - "sos.dll", - "SOS.NETCore.dll", - "System.Private.CoreLib.dll" - }; - - foreach (var compiledBinaryOfInterest in compiledBinariesOfInterest) - { - foreach (FileInfo fi in targetdi.GetFiles(compiledBinaryOfInterest)) - { - var sourceFilePath = Path.Combine(sourcedi.FullName, fi.Name); - var targetFilePath = Path.Combine(targetdi.FullName, fi.Name); - - if (File.Exists(sourceFilePath)) - { - File.Copy(sourceFilePath, targetFilePath, true); - Console.WriteLine($"| Copied file - '{fi.Name}'"); - } - } - } - } - - private static FileInfo SetupDotnet() - { - DownloadDotnetInstaller(); - InstallSharedRuntime(); - InstallDotnet(); - if (s_corelibsDir != null) - { - ModifySharedFramework(); - } - - var dotnetExe = new FileInfo(Path.Combine(s_sandboxDir.FullName, ".dotnet", "dotnet.exe")); - Debug.Assert(dotnetExe.Exists); - - return dotnetExe; - } - - private static void LaunchProcess(ProcessStartInfo processStartInfo, int timeoutMilliseconds, IDictionary environment = null) - { - Console.WriteLine(); - Console.WriteLine($"{System.Security.Principal.WindowsIdentity.GetCurrent().Name}@{Environment.MachineName} \"{processStartInfo.WorkingDirectory}\""); - Console.WriteLine($"[{DateTime.Now}] $ {processStartInfo.FileName} {processStartInfo.Arguments}"); - - if (environment != null) - { - foreach (KeyValuePair pair in environment) - { - if (!processStartInfo.Environment.ContainsKey(pair.Key)) - processStartInfo.Environment.Add(pair.Key, pair.Value); - else - processStartInfo.Environment[pair.Key] = pair.Value; - } - } - - using (var p = new Process() { StartInfo = processStartInfo }) - { - p.Start(); - if (p.WaitForExit(timeoutMilliseconds) == false) - { - // FIXME: What about clean/kill child processes? - p.Kill(); - throw new TimeoutException($"The process '{processStartInfo.FileName} {processStartInfo.Arguments}' timed out."); - } - - if (p.ExitCode != 0) - throw new Exception($"{processStartInfo.FileName} exited with error code {p.ExitCode}"); - } - } - - /// - /// Provides an interface to parse the command line arguments passed to the SoDBench. - /// - private sealed class SoDBenchOptions - { - public SoDBenchOptions() { } - - private static string NormalizePath(string path) - { - if (String.IsNullOrWhiteSpace(path)) - throw new InvalidOperationException($"'{path}' is an invalid path: cannot be null or whitespace"); - - if (path.Any(c => Path.GetInvalidPathChars().Contains(c))) - throw new InvalidOperationException($"'{path}' is an invalid path: contains invalid characters"); - - return Path.IsPathRooted(path) ? path : Path.GetFullPath(path); - } - - [Option('o', Required = false, HelpText = "Specifies the output file name for the csv document")] - public string OutputFilename - { - get { return _outputFilename; } - - set - { - _outputFilename = NormalizePath(value); - } - } - - [Option("dotnet", Required = false, HelpText = "Specifies the location of dotnet cli to use.")] - public string DotnetExecutable - { - get { return _dotnetExe; } - - set - { - _dotnetExe = NormalizePath(value); - } - } - - [Option("corelibs", Required = false, HelpText = "Specifies the location of .NET Core libraries to patch into dotnet. Cannot be used with --dotnet")] - public string CoreLibrariesDirectory - { - get { return _corelibsDir; } - - set - { - _corelibsDir = NormalizePath(value); - } - } - - [Option("architecture", Required = false, Default = "x64", HelpText = "JitBench target architecture (It must match the built product that was copied into sandbox).")] - public string TargetArchitecture { get; set; } - - [Option("channel", Required = false, Default = "master", HelpText = "Specifies the channel to use when installing the dotnet-cli")] - public string DotnetChannel { get; set; } - - [Option('v', Required = false, HelpText = "Sets output to verbose")] - public bool Verbose { get; set; } - - [Option("keep-artifacts", Required = false, HelpText = "Specifies that artifacts of this run should be kept")] - public bool KeepArtifacts { get; set; } - - public static SoDBenchOptions Parse(string[] args) - { - using (var parser = new Parser((settings) => { - settings.CaseInsensitiveEnumValues = true; - settings.CaseSensitive = false; - settings.HelpWriter = new StringWriter(); - settings.IgnoreUnknownArguments = true; - })) - { - SoDBenchOptions options = null; - parser.ParseArguments(args) - .WithParsed(parsed => options = parsed) - .WithNotParsed(errors => { - foreach (Error error in errors) - { - switch (error.Tag) - { - case ErrorType.MissingValueOptionError: - throw new ArgumentException( - $"Missing value option for command line argument '{(error as MissingValueOptionError).NameInfo.NameText}'"); - case ErrorType.HelpRequestedError: - Console.WriteLine(Usage()); - Environment.Exit(0); - break; - case ErrorType.VersionRequestedError: - Console.WriteLine(new AssemblyName(typeof(SoDBenchOptions).GetTypeInfo().Assembly.FullName).Version); - Environment.Exit(0); - break; - case ErrorType.BadFormatTokenError: - case ErrorType.UnknownOptionError: - case ErrorType.MissingRequiredOptionError: - case ErrorType.MutuallyExclusiveSetError: - case ErrorType.BadFormatConversionError: - case ErrorType.SequenceOutOfRangeError: - case ErrorType.RepeatedOptionError: - case ErrorType.NoVerbSelectedError: - case ErrorType.BadVerbSelectedError: - case ErrorType.HelpVerbRequestedError: - break; - } - } - }); - - if (options != null && !String.IsNullOrEmpty(options.DotnetExecutable) && !String.IsNullOrEmpty(options.CoreLibrariesDirectory)) - { - throw new ArgumentException("--dotnet and --corlibs cannot be used together"); - } - - return options; - } - } - - public static string Usage() - { - var parser = new Parser((parserSettings) => - { - parserSettings.CaseInsensitiveEnumValues = true; - parserSettings.CaseSensitive = false; - parserSettings.EnableDashDash = true; - parserSettings.HelpWriter = new StringWriter(); - parserSettings.IgnoreUnknownArguments = true; - }); - - var helpTextString = new HelpText - { - AddDashesToOption = true, - AddEnumValuesToHelpText = true, - AdditionalNewLineAfterOption = false, - Heading = "SoDBench", - MaximumDisplayWidth = 80, - }.AddOptions(parser.ParseArguments(new string[] { "--help" })).ToString(); - return helpTextString; - } - - private string _dotnetExe; - private string _corelibsDir; - private string _outputFilename = "measurement.csv"; - } - - private static void DeleteDirectory(DirectoryInfo dir, uint maxWait=10000) - { - foreach (var subdir in dir.GetDirectories()) - { - DeleteDirectory(subdir); - } - - // Give it time to actually delete all the files - var files = dir.GetFiles(); - bool wait = true; - uint waitTime = 0; - while (wait) - { - wait = false; - - foreach (var f in files) - { - if (File.Exists(f.FullName)) - { - try - { - File.Delete(f.FullName); - } - catch (IOException) { if (waitTime > maxWait) throw; } - catch (UnauthorizedAccessException) { if (waitTime > maxWait) throw; } - - if (File.Exists(f.FullName)) - { - wait = true; - - // Print a message every 3 seconds if the thread is stuck - if (waitTime != 0 && waitTime % 3000 == 0) - { - Console.WriteLine($"Waiting to delete {f.FullName}"); - } - } - } - } - - // Try again in 100ms - if (wait) - { - Thread.Sleep(100); - waitTime += 100; - } - } - - Directory.Delete(dir.FullName); - } - } - - // A simple class for escaping strings for CSV writing - // https://stackoverflow.com/a/769713 - // Used instead of a package because only these < 20 lines of code are needed - public static class Csv - { - public static string Escape( string s ) - { - if ( s.Contains( QUOTE ) ) - s = s.Replace( QUOTE, ESCAPED_QUOTE ); - - if ( s.IndexOfAny( CHARACTERS_THAT_MUST_BE_QUOTED ) > -1 ) - s = QUOTE + s + QUOTE; - - return s; - } - - private const string QUOTE = "\""; - private const string ESCAPED_QUOTE = "\"\""; - private static char[] CHARACTERS_THAT_MUST_BE_QUOTED = { ',', '"', '\n' }; - } -} diff --git a/src/tests/sizeondisk/sodbench/SoDBench.csproj b/src/tests/sizeondisk/sodbench/SoDBench.csproj deleted file mode 100644 index 6b63b65f0eb430..00000000000000 --- a/src/tests/sizeondisk/sodbench/SoDBench.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - exe - BuildOnly - pdbonly - true - - - - - diff --git a/src/tests/sizeondisk/sodbench/THIRD-PARTY-NOTICES.TXT b/src/tests/sizeondisk/sodbench/THIRD-PARTY-NOTICES.TXT deleted file mode 100644 index 6e029eec35798e..00000000000000 --- a/src/tests/sizeondisk/sodbench/THIRD-PARTY-NOTICES.TXT +++ /dev/null @@ -1,25 +0,0 @@ -.NET uses third-party libraries or other resources that may be -distributed under licenses different than the .NET software. - -Attributions and license notices for test cases originally authored by -third parties can be found in the respective test directories. - -In the event that we accidentally failed to list a required notice, please -bring it to our attention. Post an issue or email us: - - dotnet@microsoft.com - -The attached notices are provided for information only. - -License notice for Stack Overflow -------------------------------------- - -Policy: https://stackoverflow.com/help/licensing -License: https://creativecommons.org/licenses/by-sa/3.0/ - -Title: Dealing with commas in a CSV file -Content: https://stackoverflow.com/a/769713 -Question author: Bob The Janitor -- https://stackoverflow.com/users/55102/bob-the-janitor -Answer author: harp -- https://stackoverflow.com/users/4525/harpo - -Use: https://github.com/dotnet/runtime/blob/4893732ba881a4fb9023af1d6d4e64bb2a6eddbc/src/tests/sizeondisk/sodbench/SoDBench.cs#L735