From 15d083f85777ed68a83c653ec8bb87b717b65797 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Mon, 12 Feb 2024 15:03:07 -0800 Subject: [PATCH 01/13] Did StartupHook conversion but it doesn't generate any output :( --- src/tests/nativeaot/NativeAot.csproj | 7 +++++++ src/tests/nativeaot/StartupHook/StartupHook.cs | 9 +++++++-- src/tests/nativeaot/StartupHook/StartupHook.csproj | 6 ++---- 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 src/tests/nativeaot/NativeAot.csproj diff --git a/src/tests/nativeaot/NativeAot.csproj b/src/tests/nativeaot/NativeAot.csproj new file mode 100644 index 00000000000000..d17dca13c9ce78 --- /dev/null +++ b/src/tests/nativeaot/NativeAot.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/tests/nativeaot/StartupHook/StartupHook.cs b/src/tests/nativeaot/StartupHook/StartupHook.cs index ed85bdb0604213..6ecb6405e81ec5 100644 --- a/src/tests/nativeaot/StartupHook/StartupHook.cs +++ b/src/tests/nativeaot/StartupHook/StartupHook.cs @@ -3,13 +3,18 @@ using System; using System.Diagnostics.CodeAnalysis; +using Xunit; -class Program +public class Program { internal static int s_return; [DynamicDependency(nameof(StartupHook.Initialize), typeof(StartupHook))] - static int Main() => s_return; + [Fact] + public static int TestEntryPoint() + { + return s_return; + } } class StartupHook diff --git a/src/tests/nativeaot/StartupHook/StartupHook.csproj b/src/tests/nativeaot/StartupHook/StartupHook.csproj index f6b9b2ae9af15e..8fe98e0a91adc7 100644 --- a/src/tests/nativeaot/StartupHook/StartupHook.csproj +++ b/src/tests/nativeaot/StartupHook/StartupHook.csproj @@ -1,16 +1,14 @@ - Exe 0 true true $(NoWarn);IL2026 + true - - - + From 7bba7e45ce624ce0242b7f68c7aac3ec623ceb95 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Tue, 13 Feb 2024 13:44:36 -0800 Subject: [PATCH 02/13] Ported NativeAot ComWrappers Smoke Tests. --- src/tests/nativeaot/NativeAot.csproj | 6 +++++- src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs | 6 ++++-- .../nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj | 7 ++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/tests/nativeaot/NativeAot.csproj b/src/tests/nativeaot/NativeAot.csproj index d17dca13c9ce78..305a3dfa0b613b 100644 --- a/src/tests/nativeaot/NativeAot.csproj +++ b/src/tests/nativeaot/NativeAot.csproj @@ -1,7 +1,11 @@ - + + + false + + diff --git a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs index c4eb54cd880774..782430a94ca85f 100644 --- a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs +++ b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs @@ -6,15 +6,17 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; +using Xunit; namespace ComWrappersTests { - internal class Program + public class Program { static ComWrappers GlobalComWrappers; [DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(IComInterface))] - public static int Main() + [Fact] + public static int TestEntryPoint() { TestComInteropNullPointers(); TestComInteropRegistrationRequired(); diff --git a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj index 1d0e64a4443a5b..9cd6e0de83718b 100644 --- a/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj +++ b/src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj @@ -1,13 +1,10 @@ - Exe true true - - - $(NoWarn);IL2050 - + true + From c26dec7a86728cbc6553249bfea4d217aed23e2c Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Tue, 13 Feb 2024 15:38:52 -0800 Subject: [PATCH 03/13] Converted the majority of nativeaot tests to the new system. Not tested yet though. --- .../GenerateUnmanagedEntryPoints.cs | 8 +- .../GenerateUnmanagedEntryPoints.csproj | 2 +- .../SmokeTests/Determinism/Determinism.cs | 53 +-- .../SmokeTests/Determinism/Determinism.csproj | 4 +- .../SmokeTests/DwarfDump/DwarfDump.csproj | 2 +- .../nativeaot/SmokeTests/DwarfDump/Program.cs | 4 +- .../DynamicGenerics/DynamicGenerics.csproj | 2 +- .../DynamicGenerics/DynamicGenerics.main.cs | 312 +++++++++--------- .../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/MultiModule.cs | 4 +- .../SmokeTests/MultiModule/MultiModule.csproj | 2 +- .../nativeaot/SmokeTests/PInvoke/PInvoke.cs | 12 +- .../SmokeTests/PInvoke/PInvoke.csproj | 4 +- .../Preinitialization/Preinitialization.cs | 6 +- .../Preinitialization.csproj | 2 +- .../SmokeTests/Reflection/Reflection.cs | 6 +- .../SmokeTests/Reflection/Reflection.csproj | 2 +- .../Reflection/Reflection_FromUsage.csproj | 2 +- .../StackTraceMetadata/StackTraceMetadata.cs | 4 +- .../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 | 22 +- .../Win32Resources/Win32Resources.csproj | 2 +- 38 files changed, 411 insertions(+), 313 deletions(-) diff --git a/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.cs b/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.cs index b1251f9fc382a6..c2962fbded73a9 100644 --- a/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.cs +++ b/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.cs @@ -4,15 +4,17 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; namespace GenerateUnmanagedEntryPoints { - unsafe class Program + public unsafe class Program { [UnmanagedCallersOnly(EntryPoint = "MainAssemblyMethod")] static void MainAssemblyMethod() => Console.WriteLine($"Hello from {nameof(MainAssemblyMethod)}"); - static int Main() + [Fact] + public static int TestEntryPoint() { IntPtr methodAddress = IntPtr.Zero; IntPtr programHandle = IntPtr.Zero; @@ -52,4 +54,4 @@ static int Main() 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 a9de558d66da0e..95a6bfd2fc58ba 100644 --- a/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj +++ b/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj @@ -1,7 +1,7 @@ - Exe true + 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 f2ce9829bd69b5..46130efa7b96bd 100644 --- a/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs +++ b/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs @@ -5,10 +5,12 @@ using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; +using Xunit; public class Program { - public static int Main(string[] args) + [Fact] + public static int TestEntryPoint() { 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 cbaf77702f9c27..11dd81b4c86e85 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 c1b59061534fcb..7009c63071baf1 100644 --- a/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs +++ b/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs @@ -1,166 +1,176 @@ +using Xunit; + public class EntryPointMain { - public static int Main(string[] args) + [Fact] + public static int TestEntryPoint() { - 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) -}; + 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 55028fdee9adb9..47f2bf225da01e 100644 --- a/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs +++ b/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Runtime.ExceptionServices; using System.Text; +using Xunit; public class BringUpTest { @@ -23,7 +24,8 @@ public BringUpTest() static int finallyCounter = 0; - public static int Main() + [Fact] + public static int TestEntryPoint() { // 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 3962aa3e39b918..896199de3bbd52 100644 --- a/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.csproj +++ b/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.csproj @@ -1,12 +1,13 @@ - 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 111baa46052bfc..be8f0ceb122728 100644 --- a/src/tests/nativeaot/SmokeTests/FrameworkStrings/Baseline.csproj +++ b/src/tests/nativeaot/SmokeTests/FrameworkStrings/Baseline.csproj @@ -1,10 +1,11 @@ - Exe 0 + true true + diff --git a/src/tests/nativeaot/SmokeTests/FrameworkStrings/Program.cs b/src/tests/nativeaot/SmokeTests/FrameworkStrings/Program.cs index 73b0b99b29b6ee..2ffadce22a0798 100644 --- a/src/tests/nativeaot/SmokeTests/FrameworkStrings/Program.cs +++ b/src/tests/nativeaot/SmokeTests/FrameworkStrings/Program.cs @@ -3,73 +3,95 @@ using System; using System.Collections.Generic; +using Xunit; -// Exception message from CoreLib -const string expectedNullRefMessage = +public class Program +{ + [Fact] + public static int TestEntryPoint() + { + // 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(); -} -// Some exception message from the reflection library. -const string expectedReflectionMessage = + 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 = #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); -} -Console.WriteLine("Resources in CoreLib:"); -string[] coreLibNames = typeof(object).Assembly.GetManifestResourceNames(); -foreach (var name in coreLibNames) - Console.WriteLine(name); + 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); #if RESOURCE_KEYS -if (coreLibNames.Length != 0) - throw new Exception(); + if (coreLibNames.Length != 0) + { + Console.WriteLine($"Found {coreLibNames.Length} CoreLib Resources" + + " but expected 0."); + return 101; + } #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) - throw new Exception(); + if (refNames.Length != 0) + { + Console.WriteLine($"Found {refNames.Length} Reflection Library Resources" + + " but expected 0."); + return 101; + } #endif - -return 100; + return 100; + } +} diff --git a/src/tests/nativeaot/SmokeTests/FrameworkStrings/UseSystemResourceKeys.csproj b/src/tests/nativeaot/SmokeTests/FrameworkStrings/UseSystemResourceKeys.csproj index 752d76b2687c3c..9e78b998077c62 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 e628938c57db82..6b09d24ae2ae7e 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs @@ -6,10 +6,12 @@ using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; +using Xunit; -unsafe class Program +public unsafe class Program { - static int Main() + [Fact] + public static int TestEntryPoint() { s_success = true; @@ -26,7 +28,9 @@ static int Main() 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 8684274f76590c..509d26f40a14e1 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 32679f7769eb32..9707a29b2746e8 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx2.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx2.csproj @@ -1,7 +1,8 @@ - Exe 0 + true + true true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx512.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx512.csproj index 80bd8b2645c5e2..adfddf609f7def 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx512.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx512.csproj @@ -1,7 +1,8 @@ - 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 ac6528e395032a..e3f6131721bd8a 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx_NoAvx2.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Avx_NoAvx2.csproj @@ -1,7 +1,8 @@ - Exe 0 + true + true true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj index e86d21b891b768..1044e39468903a 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj @@ -1,7 +1,8 @@ - Exe 0 + true + true true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Sse42.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Sse42.csproj index 7d3c1b84c128f3..aae07ae7d145b2 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Sse42.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Sse42.csproj @@ -1,7 +1,8 @@ - Exe 0 + true + true true diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.cs b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.cs index 22b37c36dd5979..3e6746ac943ab3 100644 --- a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.cs +++ b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.cs @@ -5,13 +5,15 @@ using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; +using Xunit; public class ReflectionTest { const int Pass = 100; const int Fail = -1; - public static int Main() + [Fact] + public static int TestEntryPoint() { if (TestStaticBases() == Fail) return Fail; diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj index 5cfd47f9128cf8..8027baac627305 100644 --- a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj +++ b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj @@ -1,8 +1,8 @@ - Exe 0 true + true true diff --git a/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.cs b/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.cs index 92fc0284e913e2..bf2c8ab5106e8a 100644 --- a/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.cs +++ b/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.cs @@ -11,6 +11,7 @@ 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 @@ -23,7 +24,7 @@ internal class __BlockAllReflectionAttribute : Attribute { } // ensure that we can handle this (mostly an issue for C++ code generation). namespace PInvokeTests { - internal class Program + public class Program { [DllImport("PInvokeNative", CallingConvention = CallingConvention.StdCall)] private static extern int Square(int intValue); @@ -139,11 +140,12 @@ private static extern bool VerifySizeParamIndex( #else [MethodImpl(MethodImplOptions.AggressiveInlining)] #endif - static extern bool ReversePInvoke_Int_AggressiveInlining(Delegate_Int_AggressiveInlining del); + 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); @@ -171,11 +173,13 @@ 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); @@ -186,6 +190,7 @@ 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); @@ -322,7 +327,8 @@ internal enum MagicEnum MagicResult = 42, } - public static int Main() + [Fact] + public static int TestEntryPoint() { TestBlittableType(); TestBoolean(); diff --git a/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.csproj b/src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.csproj index 0a7a956d1f89fa..d4ac6c29eb1501 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,9 +11,11 @@ true + + diff --git a/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs b/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs index 5252e1f2d58c33..3986ce66b1c0c9 100644 --- a/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs +++ b/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs @@ -7,12 +7,14 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics.X86; +using Xunit; using BindingFlags = System.Reflection.BindingFlags; -internal class Program +public class Program { - private static int Main() + [Fact] + private static int TestEntryPoint() { #if !MULTIMODULE_BUILD TestHardwareIntrinsics.Run(); diff --git a/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.csproj b/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.csproj index fde40cfb5e69d6..0b9891d4a036c3 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 c569fde4d4cd9f..23498fce304cc6 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 19bff10ee7f489..26cac783c29f41 100644 --- a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs +++ b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs @@ -3,11 +3,13 @@ using System; using System.Runtime.CompilerServices; +using Xunit; class Program { [MethodImpl(MethodImplOptions.NoInlining)] - static int Main() + [Fact] + static int TestEntryPoint() { string stackTrace = Environment.StackTrace; diff --git a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.csproj b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.csproj index ad170f1dda90ed..9c197384c4bae0 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 f825042a895bea..dbdf581d8e678d 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 7a46f41961da19..83e0af14013d61 100644 --- a/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/Main.cs +++ b/src/tests/nativeaot/SmokeTests/TrimmingBehaviors/Main.cs @@ -3,28 +3,35 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -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) +public class Program { - Console.WriteLine($"===== Running test {name} ====="); - bool success = true; - try + [Fact] + public static int TestEntryPoint() { - success = t() == 100; + 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; } - catch (Exception ex) + + static bool RunTest(Func t, [CallerArgumentExpression("t")] string name = null) { - Console.WriteLine(ex.ToString()); - success = false; + 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($"===== 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 fa0c9d0e4d7b2b..feef43d9c94169 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 e91a219dc4f527..fbed5e769a0f8c 100644 --- a/src/tests/nativeaot/SmokeTests/UnitTests/Main.cs +++ b/src/tests/nativeaot/SmokeTests/UnitTests/Main.cs @@ -3,30 +3,37 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -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) +public class Program { - Console.WriteLine($"===== Running test {name} ====="); - bool success = true; - try + [Fact] + public static int TestEntryPoint() { - success = t() == 100; + 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; } - catch (Exception ex) + + static bool RunTest(Func t, [CallerArgumentExpression("t")] string name = null) { - Console.WriteLine(ex.ToString()); - success = false; + 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($"===== 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 d61a6236b1f07a..3a49e588fb7bd0 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 1dfc7a8424792f..4860616f495a62 100644 --- a/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs +++ b/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs @@ -4,19 +4,23 @@ using System; using System.Runtime.InteropServices; -unsafe +public unsafe class Program { - nint lib = 0; - - if (GetIntValueFromResource(lib, (ushort*)(nuint)(ushort)10, 0x041B) != 3) - throw new Exception(); + [Fact] + public static int TestEntryPoint() + { + nint lib = 0; - ReadOnlySpan resName = "funny"; - fixed (char* pResName = resName) - if (GetIntValueFromResource(lib, (ushort*)pResName, 0x041B) != 1) + if (GetIntValueFromResource(lib, (ushort*)(nuint)(ushort)10, 0x041B) != 3) throw new Exception(); - return 100; + ReadOnlySpan resName = "funny"; + fixed (char* pResName = resName) + if (GetIntValueFromResource(lib, (ushort*)pResName, 0x041B) != 1) + throw new Exception(); + + 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 2fbfd993e96942..82fb7430013b92 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 From 5a75db0bed5c9b2e768ed050f7cf0038b534d930 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Wed, 14 Feb 2024 13:23:01 -0800 Subject: [PATCH 04/13] Fixed the individual nativeaot compilation errors, but it still doesn't build. It can't generate the runner file for some reason. --- src/tests/nativeaot/NativeAot.csproj | 7 ++++++- src/tests/nativeaot/SmokeTests/Determinism/Determinism.cs | 8 ++++---- .../SmokeTests/Preinitialization/Preinitialization.cs | 2 +- src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs | 8 ++++---- .../SmokeTests/StackTraceMetadata/StackTraceMetadata.cs | 6 +++--- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/tests/nativeaot/NativeAot.csproj b/src/tests/nativeaot/NativeAot.csproj index 305a3dfa0b613b..cf8e44f2d4aa26 100644 --- a/src/tests/nativeaot/NativeAot.csproj +++ b/src/tests/nativeaot/NativeAot.csproj @@ -1,6 +1,11 @@ - + + + + + + diff --git a/src/tests/nativeaot/SmokeTests/Determinism/Determinism.cs b/src/tests/nativeaot/SmokeTests/Determinism/Determinism.cs index 7a8ab69aef79b8..c56b37f342ea6e 100644 --- a/src/tests/nativeaot/SmokeTests/Determinism/Determinism.cs +++ b/src/tests/nativeaot/SmokeTests/Determinism/Determinism.cs @@ -5,14 +5,14 @@ using System.IO; using Xunit; -using var baseline = File.OpenRead("baseline.object"); -using var compare = File.OpenRead("compare.object"); - 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}"); @@ -38,7 +38,7 @@ public static int TestEntryPoint() { Delegates.Run(); Devirtualization.Run(); - Generics.Run(); + // Generics.Run(); Interfaces.Run(); } diff --git a/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs b/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs index 3986ce66b1c0c9..07de660eaac8b1 100644 --- a/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs +++ b/src/tests/nativeaot/SmokeTests/Preinitialization/Preinitialization.cs @@ -14,7 +14,7 @@ public class Program { [Fact] - private static int TestEntryPoint() + public static int TestEntryPoint() { #if !MULTIMODULE_BUILD TestHardwareIntrinsics.Run(); diff --git a/src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs b/src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs index 63f072249173f2..12e19fe779393e 100644 --- a/src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs +++ b/src/tests/nativeaot/SmokeTests/Reflection/Reflection.cs @@ -21,7 +21,7 @@ public static class ReflectionTest { [Fact] - private static int TestEntryPoint() + public static int TestEntryPoint() { // Things I would like to test, but we don't fully support yet: // * Interface method is reflectable if we statically called it through a constrained call @@ -90,7 +90,7 @@ private static int TestEntryPoint() TestByRefReturnInvoke.Run(); TestAssemblyLoad.Run(); TestBaseOnlyUsedFromCode.Run(); - TestEntryPoint.Run(); + TestStartPoint.Run(); return 100; } @@ -2535,11 +2535,11 @@ public static void Run() } } - class TestEntryPoint + class TestStartPoint { public static void Run() { - Console.WriteLine(nameof(TestEntryPoint)); + Console.WriteLine(nameof(TestStartPoint)); if (Assembly.GetEntryAssembly().EntryPoint == null) throw new Exception(); } diff --git a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs index 26cac783c29f41..a95f1ae4628eef 100644 --- a/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs +++ b/src/tests/nativeaot/SmokeTests/StackTraceMetadata/StackTraceMetadata.cs @@ -5,11 +5,11 @@ using System.Runtime.CompilerServices; using Xunit; -class Program +public class Program { [MethodImpl(MethodImplOptions.NoInlining)] [Fact] - static int TestEntryPoint() + public static int TestEntryPoint() { string stackTrace = Environment.StackTrace; @@ -20,7 +20,7 @@ static int TestEntryPoint() #else const bool expected = true; #endif - bool actual = stackTrace.Contains(nameof(Main)) && stackTrace.Contains(nameof(Program)); + bool actual = stackTrace.Contains(nameof(TestEntryPoint)) && stackTrace.Contains(nameof(Program)); return expected == actual ? 100 : 1; } From d1922f1a5a553388dda25aea40e23ad4c93c139b Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Wed, 14 Feb 2024 15:28:32 -0800 Subject: [PATCH 05/13] Disabled MultiModule tests to check actual progress, and it builds now! --- src/tests/nativeaot/NativeAot.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/nativeaot/NativeAot.csproj b/src/tests/nativeaot/NativeAot.csproj index cf8e44f2d4aa26..2b643c91f2b378 100644 --- a/src/tests/nativeaot/NativeAot.csproj +++ b/src/tests/nativeaot/NativeAot.csproj @@ -6,6 +6,7 @@ + From 92db5ebb3bae9e35d17cfac8069d3d7b981f52d2 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Thu, 15 Feb 2024 14:28:43 -0800 Subject: [PATCH 06/13] DRAFT: Fixed the args build problem in DynamicGenerics test. --- src/tests/nativeaot/NativeAot.csproj | 3 ++- .../SmokeTests/DynamicGenerics/DynamicGenerics.main.cs | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tests/nativeaot/NativeAot.csproj b/src/tests/nativeaot/NativeAot.csproj index 2b643c91f2b378..60e35cb22e85a0 100644 --- a/src/tests/nativeaot/NativeAot.csproj +++ b/src/tests/nativeaot/NativeAot.csproj @@ -5,12 +5,13 @@ - false + + true diff --git a/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs b/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs index 7009c63071baf1..8c3ffe4145600e 100644 --- a/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs +++ b/src/tests/nativeaot/SmokeTests/DynamicGenerics/DynamicGenerics.main.cs @@ -165,6 +165,13 @@ public static int TestEntryPoint() 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[] { }; + bool passed = CoreFXTestLibrary.Internal.Runner.RunTests(tests, args); CoreFXTestLibrary.Logger.LogInformation("Passed: {0}, Failed: {1}, Number of Tests Run: {2}", CoreFXTestLibrary.Internal.Runner.NumPassedTests, From 09aeacf896c2b28fc9f6d987f78406ef6cd9d0a9 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Fri, 16 Feb 2024 15:11:57 -0800 Subject: [PATCH 07/13] DRAFT: Saving my progress. --- src/tests/nativeaot/CustomMain/CustomMain.cs | 6 ++++-- src/tests/nativeaot/CustomMain/CustomMain.csproj | 2 +- src/tests/nativeaot/NativeAot.csproj | 9 ++------- .../SmokeTests/Win32Resources/Win32Resources.cs | 1 + 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/tests/nativeaot/CustomMain/CustomMain.cs b/src/tests/nativeaot/CustomMain/CustomMain.cs index 914809961d778d..3bdae49a6b0e59 100644 --- a/src/tests/nativeaot/CustomMain/CustomMain.cs +++ b/src/tests/nativeaot/CustomMain/CustomMain.cs @@ -4,8 +4,9 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; -class Program +public class Program { // Each of the module initializer, class constructor, and IncrementExitCode // should be executed exactly once, causing this to each 100 by program exit. @@ -32,7 +33,8 @@ static void IncrementExitCode(int amount) int ExitCode; - static int Main(string[] args) + [Fact] + public static int TestEntryPoint() { 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 f3787228534828..4746f0a95eef5a 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/NativeAot.csproj b/src/tests/nativeaot/NativeAot.csproj index 60e35cb22e85a0..e306013f741399 100644 --- a/src/tests/nativeaot/NativeAot.csproj +++ b/src/tests/nativeaot/NativeAot.csproj @@ -1,17 +1,12 @@ - - - - - + + false - - true diff --git a/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs b/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs index 4860616f495a62..73b8f204fcd090 100644 --- a/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs +++ b/src/tests/nativeaot/SmokeTests/Win32Resources/Win32Resources.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.InteropServices; +using Xunit; public unsafe class Program { From 4ec7f57eff121a276690ef72e7a29dae8ca640fa Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Wed, 21 Feb 2024 14:24:11 -0800 Subject: [PATCH 08/13] Ported the Managed test tree to the MergedWrapperSystem. --- src/tests/managed/Compilation/Compilation.cs | 22 ++++++++++++++----- .../managed/Compilation/Compilation.csproj | 2 +- src/tests/managed/Managed.csproj | 11 ++++++++++ 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 src/tests/managed/Managed.csproj 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 + + + + From 5610b092ba0e085e802c2d4eb7ccc47d97f1d8ae Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Wed, 21 Feb 2024 15:10:43 -0800 Subject: [PATCH 09/13] DRAFT: Delete the 'sizeondisk' subtree because it is no longer used. --- 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 - 4 files changed, 797 deletions(-) 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/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 From 0c0adb5d8a2f22085f9a3581029ef36385b8f519 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Tue, 27 Feb 2024 10:32:53 -0800 Subject: [PATCH 10/13] Fixed the remaining NativeAOT ported tests. --- src/tests/nativeaot/NativeAot.csproj | 15 +++++++++++++-- .../SmokeTests/MultiModule/MultiModule.csproj | 4 +++- .../{Library.cs => MultiModuleLibrary.cs} | 0 .../{Library.csproj => MultiModuleLibrary.csproj} | 3 ++- 4 files changed, 18 insertions(+), 4 deletions(-) rename src/tests/nativeaot/SmokeTests/MultiModule/{Library.cs => MultiModuleLibrary.cs} (100%) rename src/tests/nativeaot/SmokeTests/MultiModule/{Library.csproj => MultiModuleLibrary.csproj} (82%) diff --git a/src/tests/nativeaot/NativeAot.csproj b/src/tests/nativeaot/NativeAot.csproj index e306013f741399..71129fe76afc1a 100644 --- a/src/tests/nativeaot/NativeAot.csproj +++ b/src/tests/nativeaot/NativeAot.csproj @@ -1,8 +1,6 @@ - - @@ -10,4 +8,17 @@ + + + + + + <_ResolvedProjectReferencePaths Remove="@(_ResolvedProjectReferencePaths)" + Condition="'%(Extension)' != '.dll'" /> + + diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj index 8027baac627305..0da3dbfc0d4b95 100644 --- a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj +++ b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj @@ -8,11 +8,13 @@ true true + + - + + @@ -8,17 +20,4 @@ - - - - - - <_ResolvedProjectReferencePaths Remove="@(_ResolvedProjectReferencePaths)" - Condition="'%(Extension)' != '.dll'" /> - - diff --git a/src/tests/nativeaot/SmokeTests/Determinism/Determinism.csproj b/src/tests/nativeaot/SmokeTests/Determinism/Determinism.csproj index b9f452e8e91c5f..50e1f1ace30947 100644 --- a/src/tests/nativeaot/SmokeTests/Determinism/Determinism.csproj +++ b/src/tests/nativeaot/SmokeTests/Determinism/Determinism.csproj @@ -3,6 +3,7 @@ 0 true true + true diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModuleLibrary.cs b/src/tests/nativeaot/SmokeTests/MultiModule/Library.cs similarity index 100% rename from src/tests/nativeaot/SmokeTests/MultiModule/MultiModuleLibrary.cs rename to src/tests/nativeaot/SmokeTests/MultiModule/Library.cs diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModuleLibrary.csproj b/src/tests/nativeaot/SmokeTests/MultiModule/Library.csproj similarity index 82% rename from src/tests/nativeaot/SmokeTests/MultiModule/MultiModuleLibrary.csproj rename to src/tests/nativeaot/SmokeTests/MultiModule/Library.csproj index 67f33d20ec9ea6..06689f14d05758 100644 --- a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModuleLibrary.csproj +++ b/src/tests/nativeaot/SmokeTests/MultiModule/Library.csproj @@ -5,6 +5,6 @@ - + diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.cs b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.cs index 3e6746ac943ab3..22b37c36dd5979 100644 --- a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.cs +++ b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.cs @@ -5,15 +5,13 @@ using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; -using Xunit; public class ReflectionTest { const int Pass = 100; const int Fail = -1; - [Fact] - public static int TestEntryPoint() + public static int Main() { if (TestStaticBases() == Fail) return Fail; diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj index 0da3dbfc0d4b95..ea3c13fc6ba55d 100644 --- a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj +++ b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj @@ -1,8 +1,8 @@ + Exe 0 true - true true @@ -14,7 +14,7 @@ - + true diff --git a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj index ea3c13fc6ba55d..7536c7d390b393 100644 --- a/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj +++ b/src/tests/nativeaot/SmokeTests/MultiModule/MultiModule.csproj @@ -3,6 +3,7 @@ Exe 0 true + true true diff --git a/src/tests/nativeaot/StartupHook/StartupHook.csproj b/src/tests/nativeaot/StartupHook/StartupHook.csproj index 8fe98e0a91adc7..38469401344b2c 100644 --- a/src/tests/nativeaot/StartupHook/StartupHook.csproj +++ b/src/tests/nativeaot/StartupHook/StartupHook.csproj @@ -4,6 +4,8 @@ true true $(NoWarn);IL2026 + + true