diff --git a/tests/xharness/BCLTestImporter/BCLTestProjectGenerator.cs b/tests/xharness/BCLTestImporter/BCLTestProjectGenerator.cs index 6859294cad93..5a7a07126dcf 100644 --- a/tests/xharness/BCLTestImporter/BCLTestProjectGenerator.cs +++ b/tests/xharness/BCLTestImporter/BCLTestProjectGenerator.cs @@ -14,122 +14,200 @@ namespace Xharness.BCLTestImporter { /// public class BCLTestProjectGenerator { + // less typing + class ProjectsDefinitions : Dictionary { } + // we have two different types of list, those that are for the iOS like projects (ios, tvos and watch os) and those // for mac - static readonly List commoniOSTestProjects = new List { + static readonly ProjectsDefinitions commoniOSTestProjects = new ProjectsDefinitions { // NUNIT TESTS - // BCL tests group 1 - new BclTestProjectInfo { Name = "SystemCoreTests", assemblies = new [] { "monotouch_System.Core_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemNumericsTests", assemblies = new [] { "monotouch_System.Numerics_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemRuntimeSerializationTests", assemblies = new [] { "monotouch_System.Runtime.Serialization_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemTransactionsTests", assemblies = new [] { "monotouch_System.Transactions_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemXmlTests", assemblies = new [] { "monotouch_System.Xml_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemXmlLinqTests", assemblies = new [] { "monotouch_System.Xml.Linq_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "MonoSecurityTests", assemblies = new [] { "monotouch_Mono.Security_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemComponentModelDataAnnotationsTests", assemblies = new [] { "monotouch_System.ComponentModel.DataAnnotations_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemJsonTests", assemblies = new [] { "monotouch_System.Json_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemServiceModelWebTests", assemblies = new [] { "monotouch_System.ServiceModel.Web_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemIOCompressionTests", assemblies = new [] { "monotouch_System.IO.Compression_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemIOCompressionFileSystemTests", assemblies = new [] { "monotouch_System.IO.Compression.FileSystem_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "MonoCSharpTests", assemblies = new [] { "monotouch_Mono.CSharp_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemSecurityTests", assemblies = new [] { "monotouch_System.Security_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "MonoDataSqliteTests", assemblies = new [] { "monotouch_Mono.Data.Sqlite_test.dll" }, Group = "BCL tests group 1" }, - new BclTestProjectInfo { Name = "MonoRuntimeTests", assemblies = new [] { "monotouch_Mono.Runtime.Tests_test.dll" }, Group = "BCL tests group 1" }, + ["BCL tests group 1"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + (Name: "SystemCoreTests", Assemblies: new [] { "monotouch_System.Core_test.dll" }), + (Name: "SystemNumericsTests", Assemblies: new [] { "monotouch_System.Numerics_test.dll" }), + (Name: "SystemRuntimeSerializationTests", Assemblies: new [] { "monotouch_System.Runtime.Serialization_test.dll" }), + (Name: "SystemTransactionsTests", Assemblies: new [] { "monotouch_System.Transactions_test.dll" }), + (Name: "SystemXmlTests", Assemblies: new [] { "monotouch_System.Xml_test.dll" }), + (Name: "SystemXmlLinqTests", Assemblies: new [] { "monotouch_System.Xml.Linq_test.dll" }), + (Name: "MonoSecurityTests", Assemblies: new [] { "monotouch_Mono.Security_test.dll" }), + (Name: "SystemComponentModelDataAnnotationsTests", Assemblies: new [] { "monotouch_System.ComponentModel.DataAnnotations_test.dll" }), + (Name: "SystemJsonTests", Assemblies: new [] { "monotouch_System.Json_test.dll" }), + (Name: "SystemServiceModelWebTests", Assemblies: new [] { "monotouch_System.ServiceModel.Web_test.dll" }), + (Name: "SystemIOCompressionTests", Assemblies: new [] { "monotouch_System.IO.Compression_test.dll" }), + (Name: "SystemIOCompressionFileSystemTests", Assemblies: new [] { "monotouch_System.IO.Compression.FileSystem_test.dll" }), + (Name: "MonoCSharpTests", Assemblies: new [] { "monotouch_Mono.CSharp_test.dll" }), + (Name: "SystemSecurityTests", Assemblies: new [] { "monotouch_System.Security_test.dll" }), + (Name: "MonoDataSqliteTests", Assemblies: new [] { "monotouch_Mono.Data.Sqlite_test.dll" }), + (Name: "MonoRuntimeTests", Assemblies: new [] { "monotouch_Mono.Runtime.Tests_test.dll" }), + }), - // BCL tests group 2 - new BclTestProjectInfo { Name = "SystemTests", assemblies = new[] {"monotouch_System_test.dll" }, Group = "BCL tests group 2" }, - new BclTestProjectInfo { Name = "SystemDataTests", assemblies = new [] { "monotouch_System.Data_test.dll" }, Group = "BCL tests group 2" }, - new BclTestProjectInfo { Name = "SystemDataDataSetExtensionsTests", assemblies = new [] { "monotouch_System.Data.DataSetExtensions_test.dll" }, Group = "BCL tests group 2" }, - new BclTestProjectInfo { Name = "SystemNetHttpTests", assemblies = new [] { "monotouch_System.Net.Http_test.dll" }, Group = "BCL tests group 2" }, - new BclTestProjectInfo { Name = "MonoDataTdsTests", assemblies = new [] { "monotouch_Mono.Data.Tds_test.dll" }, Group = "BCL tests group 2" }, - new BclTestProjectInfo { Name = "SystemServiceModelTests", assemblies = new [] { "monotouch_System.ServiceModel_test.dll" }, Group = "BCL tests group 2" }, - new BclTestProjectInfo { Name = "CorlibTests", assemblies = new [] { "monotouch_corlib_test.dll" }, Group = "BCL tests group 2", TimeoutMultiplier = 2 }, - new BclTestProjectInfo { Name = "SystemWebServicesTests", assemblies = new [] { "monotouch_System.Web.Services_test.dll" }, Group = "BCL tests group 2" }, + ["BCL tests group 2"] = ( + ExtraArgs: null, + TimeoutMultiplier: 2, + Projects: new [] { + ( Name: "SystemTests", Assemblies: new[] {"monotouch_System_test.dll" }), + ( Name: "SystemDataTests", Assemblies: new [] { "monotouch_System.Data_test.dll" }), + ( Name: "SystemDataDataSetExtensionsTests", Assemblies: new [] { "monotouch_System.Data.DataSetExtensions_test.dll" }), + ( Name: "SystemNetHttpTests", Assemblies: new [] { "monotouch_System.Net.Http_test.dll" }), + ( Name: "MonoDataTdsTests", Assemblies: new [] { "monotouch_Mono.Data.Tds_test.dll" }), + ( Name: "SystemServiceModelTests", Assemblies: new [] { "monotouch_System.ServiceModel_test.dll" }), + ( Name: "CorlibTests", Assemblies: new [] { "monotouch_corlib_test.dll" }), + ( Name: "SystemWebServicesTests", Assemblies: new [] { "monotouch_System.Web.Services_test.dll" }), + }), // XUNIT TESTS - // BCL tests group 3 - new BclTestProjectInfo { Name = "SystemDataXunit", assemblies = new [] { "monotouch_System.Data_xunit-test.dll" }, Group = "BCL tests group 3" }, - new BclTestProjectInfo { Name = "SystemJsonXunit", assemblies = new [] { "monotouch_System.Json_xunit-test.dll" }, Group = "BCL tests group 3" }, - new BclTestProjectInfo { Name = "SystemSecurityXunit", assemblies = new [] { "monotouch_System.Security_xunit-test.dll" }, Group = "BCL tests group 3" }, - new BclTestProjectInfo { Name = "SystemLinqXunit", assemblies = new [] { "monotouch_System.Xml.Linq_xunit-test.dll" }, Group = "BCL tests group 3" }, - new BclTestProjectInfo { Name = "SystemComponentModelCompositionXunit", assemblies = new [] { "monotouch_System.ComponentModel.Composition_xunit-test.dll" }, Group = "BCL tests group 3" }, - new BclTestProjectInfo { Name = "SystemRuntimeSerializationXunit", assemblies = new [] { "monotouch_System.Runtime.Serialization_xunit-test.dll" }, Group = "BCL tests group 3" }, - new BclTestProjectInfo { Name = "SystemXmlXunit", assemblies = new [] { "monotouch_System.Xml_xunit-test.dll" }, Group = "BCL tests group 3" }, - new BclTestProjectInfo { Name = "SystemRuntimeCompilerServicesUnsafeXunit", assemblies = new [] { "monotouch_System.Runtime.CompilerServices.Unsafe_xunit-test.dll" }, Group = "BCL tests group 3" }, + ["BCL tests group 3"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "SystemDataXunit", Assemblies: new [] { "monotouch_System.Data_xunit-test.dll" }), + ( Name: "SystemJsonXunit", Assemblies: new [] { "monotouch_System.Json_xunit-test.dll" }), + ( Name: "SystemSecurityXunit", Assemblies: new [] { "monotouch_System.Security_xunit-test.dll" }), + ( Name: "SystemLinqXunit", Assemblies: new [] { "monotouch_System.Xml.Linq_xunit-test.dll" }), + ( Name: "SystemComponentModelCompositionXunit", Assemblies: new [] { "monotouch_System.ComponentModel.Composition_xunit-test.dll" }), + ( Name: "SystemRuntimeSerializationXunit", Assemblies: new [] { "monotouch_System.Runtime.Serialization_xunit-test.dll" }), + ( Name: "SystemXmlXunit", Assemblies: new [] { "monotouch_System.Xml_xunit-test.dll" }), + ( Name: "SystemRuntimeCompilerServicesUnsafeXunit", Assemblies: new [] { "monotouch_System.Runtime.CompilerServices.Unsafe_xunit-test.dll" }), + }), - // BCL tests group 4 - new BclTestProjectInfo { Name = "SystemNumericsXunit", assemblies = new [] { "monotouch_System.Numerics_xunit-test.dll" }, Group = "BCL tests group 4" }, - new BclTestProjectInfo { Name = "MicrosoftCSharpXunit", assemblies = new [] { "monotouch_Microsoft.CSharp_xunit-test.dll" }, Group = "BCL tests group 4" }, + ["BCL tests group 4"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "SystemNumericsXunit", Assemblies: new [] { "monotouch_System.Numerics_xunit-test.dll" }), + ( Name: "MicrosoftCSharpXunit", Assemblies: new [] { "monotouch_Microsoft.CSharp_xunit-test.dll" }), + }), // BCL tests group 5 - new BclTestProjectInfo { Name = "SystemNetHttpUnitTestsXunit", assemblies = new [] { "monotouch_System.Net.Http.UnitTests_xunit-test.dll" }, Group = "BCL tests group 5" }, - new BclTestProjectInfo { Name = "SystemNetHttpFunctionalTestsXunit", assemblies = new [] { "monotouch_System.Net.Http.FunctionalTests_xunit-test.dll" }, Group = "BCL tests group 5" }, + ["BCL tests group 5"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "SystemNetHttpUnitTestsXunit", Assemblies: new [] { "monotouch_System.Net.Http.UnitTests_xunit-test.dll" }), + ( Name: "SystemNetHttpFunctionalTestsXunit", Assemblies: new [] { "monotouch_System.Net.Http.FunctionalTests_xunit-test.dll" }), + }), // Special assemblies that are in a single application due to their size being to large for the iOS 32b. - new BclTestProjectInfo { Name = "mscorlib Part 1", assemblies = new [] { "monotouch_corlib_xunit-test.part1.dll" }, Group = "mscorlib Part 1" }, // special testcase for the corlib which is later used in xHarness for diff config options - new BclTestProjectInfo { Name = "mscorlib Part 2", assemblies = new [] { "monotouch_corlib_xunit-test.part2.dll" }, Group = "mscorlib Part 2" }, - new BclTestProjectInfo { Name = "mscorlib Part 3", assemblies = new [] { "monotouch_corlib_xunit-test.part3.dll" }, Group = "mscorlib Part 3" }, - new BclTestProjectInfo { Name = "SystemCoreXunit Part 1", assemblies = new [] { "monotouch_System.Core_xunit-test.part1.dll" }, Group = "SystemCoreXunit Part 1" }, - new BclTestProjectInfo { Name = "SystemCoreXunit Part 2", assemblies = new [] { "monotouch_System.Core_xunit-test.part2.dll" }, Group = "SystemCoreXunit Part 2" }, - new BclTestProjectInfo { Name = "SystemXunit", assemblies = new [] { "monotouch_System_xunit-test.dll" }, ExtraArgs = $"--xml={Path.Combine (Harness.RootDirectory, "bcl-test", "SystemXunitLinker.xml")} --optimize=-custom-attributes-removal", Group = "SystemXunit" }, // special case due to the need of the extra args + ["mscorlib Part 1"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "mscorlib Part 1", Assemblies: new [] { "monotouch_corlib_xunit-test.part1.dll" }), // special testcase for the corlib which is later used in xHarness for diff config options + }), + ["mscorlib Part 2"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "mscorlib Part 2", Assemblies: new [] { "monotouch_corlib_xunit-test.part2.dll" }), + }), + ["mscorlib Part 3"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "mscorlib Part 3", Assemblies: new [] { "monotouch_corlib_xunit-test.part3.dll" }), + }), + ["SystemCoreXunit Part 1"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "SystemCoreXunit Part 1", Assemblies: new [] { "monotouch_System.Core_xunit-test.part1.dll" }), + }), + ["SystemCoreXunit Part 2"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "SystemCoreXunit Part 2", Assemblies: new [] { "monotouch_System.Core_xunit-test.part2.dll" }), + }), + ["SystemXunit"] = ( + ExtraArgs: $"--xml={Path.Combine (Harness.RootDirectory, "bcl-test", "SystemXunitLinker.xml")} --optimize=-custom-attributes-removal", // special case due to the need of the extra args, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "SystemXunit", Assemblies: new [] { "monotouch_System_xunit-test.dll" }), + }), }; - private static readonly List macTestProjects = new List { - + private static readonly ProjectsDefinitions macTestProjects = new ProjectsDefinitions { + // NUNIT Projects - new BclTestProjectInfo { Name = "MonoDataSqliteTests", assemblies = new [] { "xammac_net_4_5_Mono.Data.Sqlite_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "MonoDataTdsTests", assemblies = new [] { "xammac_net_4_5_Mono.Data.Tds_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "MonoMessagingTests", assemblies = new [] { "xammac_net_4_5_Mono.Messaging_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "MonoPoxisTests", assemblies = new [] { "xammac_net_4_5_Mono.Posix_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "MonoSecurityTests", assemblies = new [] { "xammac_net_4_5_Mono.Security_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemConfigurationTests", assemblies = new [] { "xammac_net_4_5_System.Configuration_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemDataLinqTests", assemblies = new [] { "xammac_net_4_5_System.Data.Linq_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemDataTests", assemblies = new [] { "xammac_net_4_5_System.Data_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemIOCompressionFileSystemTests", assemblies = new [] { "xammac_net_4_5_System.IO.Compression.FileSystem_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemIOCompressionTests", assemblies = new [] { "xammac_net_4_5_System.IO.Compression_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemIdentityModelTests", assemblies = new [] { "xammac_net_4_5_System.IdentityModel_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemJsonTests", assemblies = new [] { "xammac_net_4_5_System.Json_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemMessagingTests", assemblies = new [] { "xammac_net_4_5_System.Messaging_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemNetHttpWebRequestTests", assemblies = new [] { "xammac_net_4_5_System.Net.Http.WebRequest_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemNumericsTests", assemblies = new [] { "xammac_net_4_5_System.Numerics_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemRuntimeSerializationFormattersSoapTests", assemblies = new [] { "xammac_net_4_5_System.Runtime.Serialization.Formatters.Soap_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemRuntimeSerializationTests", assemblies = new [] { "xammac_net_4_5_System.Runtime.Serialization_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemServiceModelWebTest", assemblies = new [] { "xammac_net_4_5_System.ServiceModel.Web_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemServiceModelTests", assemblies = new [] { "xammac_net_4_5_System.ServiceModel_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemTransactionsTests", assemblies = new [] { "xammac_net_4_5_System.Transactions_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemWebServicesTests", assemblies = new [] { "xammac_net_4_5_System.Web.Services_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemXmlLinqTests", assemblies = new [] { "xammac_net_4_5_System.Xml.Linq_test.dll" }, Group = "Mac OS X BCL tests group 1" }, - new BclTestProjectInfo { Name = "SystemDataDataSetExtensionsTests", assemblies = new [] { "xammac_net_4_5_System.Data.DataSetExtensions_test.dll" }, Group = "Mac OS X BCL tests group 1" }, + ["Mac OS X BCL tests group 1"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "MonoDataSqliteTests", Assemblies: new [] { "xammac_net_4_5_Mono.Data.Sqlite_test.dll" }), + ( Name: "MonoDataTdsTests", Assemblies: new [] { "xammac_net_4_5_Mono.Data.Tds_test.dll" }), + ( Name: "MonoMessagingTests", Assemblies: new [] { "xammac_net_4_5_Mono.Messaging_test.dll" }), + ( Name: "MonoPoxisTests", Assemblies: new [] { "xammac_net_4_5_Mono.Posix_test.dll" }), + ( Name: "MonoSecurityTests", Assemblies: new [] { "xammac_net_4_5_Mono.Security_test.dll" }), + ( Name: "SystemConfigurationTests", Assemblies: new [] { "xammac_net_4_5_System.Configuration_test.dll" }), + ( Name: "SystemDataLinqTests", Assemblies: new [] { "xammac_net_4_5_System.Data.Linq_test.dll" }), + ( Name: "SystemDataTests", Assemblies: new [] { "xammac_net_4_5_System.Data_test.dll" }), + ( Name: "SystemIOCompressionFileSystemTests", Assemblies: new [] { "xammac_net_4_5_System.IO.Compression.FileSystem_test.dll" }), + ( Name: "SystemIOCompressionTests", Assemblies: new [] { "xammac_net_4_5_System.IO.Compression_test.dll" }), + ( Name: "SystemIdentityModelTests", Assemblies: new [] { "xammac_net_4_5_System.IdentityModel_test.dll" }), + ( Name: "SystemJsonTests", Assemblies: new [] { "xammac_net_4_5_System.Json_test.dll" }), + ( Name: "SystemMessagingTests", Assemblies: new [] { "xammac_net_4_5_System.Messaging_test.dll" }), + ( Name: "SystemNetHttpWebRequestTests", Assemblies: new [] { "xammac_net_4_5_System.Net.Http.WebRequest_test.dll" }), + ( Name: "SystemNumericsTests", Assemblies: new [] { "xammac_net_4_5_System.Numerics_test.dll" }), + ( Name: "SystemRuntimeSerializationFormattersSoapTests", Assemblies: new [] { "xammac_net_4_5_System.Runtime.Serialization.Formatters.Soap_test.dll" }), + ( Name: "SystemRuntimeSerializationTests", Assemblies: new [] { "xammac_net_4_5_System.Runtime.Serialization_test.dll" }), + ( Name: "SystemServiceModelWebTest", Assemblies: new [] { "xammac_net_4_5_System.ServiceModel.Web_test.dll" }), + ( Name: "SystemServiceModelTests", Assemblies: new [] { "xammac_net_4_5_System.ServiceModel_test.dll" }), + ( Name: "SystemTransactionsTests", Assemblies: new [] { "xammac_net_4_5_System.Transactions_test.dll" }), + ( Name: "SystemWebServicesTests", Assemblies: new [] { "xammac_net_4_5_System.Web.Services_test.dll" }), + ( Name: "SystemXmlLinqTests", Assemblies: new [] { "xammac_net_4_5_System.Xml.Linq_test.dll" }), + ( Name: "SystemDataDataSetExtensionsTests", Assemblies: new [] { "xammac_net_4_5_System.Data.DataSetExtensions_test.dll" }), + }), - new BclTestProjectInfo { Name = "SystemNetHttpTests", assemblies = new [] { "xammac_net_4_5_System.Net.Http_test.dll" }, Group = "Mac OS X BCL tests group 2" }, // do not mix with SystemNetHttpWebRequestTests since there is a type collision - new BclTestProjectInfo { Name = "SystemComponentModelDataAnnotationsTests", assemblies = new [] { "xammac_net_4_5_System.ComponentModel.DataAnnotations_test.dll" }, Group = "Mac OS X BCL tests group 2" }, - new BclTestProjectInfo { Name = "SystemCoreTests", assemblies = new [] { "xammac_net_4_5_System.Core_test.dll" }, Group = "Mac OS X BCL tests group 2" }, - new BclTestProjectInfo { Name = "SystemSecurityTests", assemblies = new [] { "xammac_net_4_5_System.Security_test.dll" }, Group = "Mac OS X BCL tests group 2" }, - new BclTestProjectInfo { Name = "SystemXmlTests", assemblies = new [] { "xammac_net_4_5_System.Xml_test.dll" }, Group = "Mac OS X BCL tests group 2" }, - new BclTestProjectInfo { Name = "SystemTests", assemblies = new [] { "xammac_net_4_5_System_test.dll" }, Group = "Mac OS X BCL tests group 2" }, - new BclTestProjectInfo { Name = "MonoCSharpTests", assemblies = new [] { "xammac_net_4_5_Mono.CSharp_test.dll" }, Group = "Mac OS X BCL tests group 2" }, // if add to the first group, it blocks 'til a timeout, mono issue - - new BclTestProjectInfo { Name = "CorlibTests", assemblies = new [] { "xammac_net_4_5_corlib_test.dll" }, Group = "Mac OS X BCL tests group 3" }, - - // xUnit Projects - new BclTestProjectInfo { Name = "MicrosoftCSharpXunit", assemblies = new [] { "xammac_net_4_5_Microsoft.CSharp_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemComponentModelCompositionXunit", assemblies = new [] { "xammac_net_4_5_System.ComponentModel.Composition_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemCoreXunit", assemblies = new [] { "xammac_net_4_5_System.Core_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemDataXunit", assemblies = new [] { "xammac_net_4_5_System.Data_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemJsonXunit", assemblies = new [] { "xammac_net_4_5_System.Json_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemNetHttpFunctionalTestsXunit", assemblies = new [] { "xammac_net_4_5_System.Net.Http.FunctionalTests_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemNetHttpUnitTestsXunit", assemblies = new [] { "xammac_net_4_5_System.Net.Http.UnitTests_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemNumericsXunit", assemblies = new [] { "xammac_net_4_5_System.Numerics_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemRuntimeCompilerServicesUnsafeXunit", assemblies = new [] { "xammac_net_4_5_System.Runtime.CompilerServices.Unsafe_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemSecurityXunit", assemblies = new [] { "xammac_net_4_5_System.Security_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemXmlLinqXunit", assemblies = new [] { "xammac_net_4_5_System.Xml.Linq_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemXmlXunit", assemblies = new [] { "xammac_net_4_5_System.Xml_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - new BclTestProjectInfo { Name = "SystemXunit", assemblies = new [] { "xammac_net_4_5_System_xunit-test.dll" }, Group = "Mac OS X BCL tests group 4" }, - - new BclTestProjectInfo { Name = "mscorlib", assemblies = new [] { "xammac_net_4_5_corlib_xunit-test.dll" }, Group = "mscorlib" },// special testcase for the corlib which is later used in xHarness for diff config options + ["Mac OS X BCL tests group 2"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "SystemNetHttpTests", Assemblies: new [] { "xammac_net_4_5_System.Net.Http_test.dll" }), // do not mix with SystemNetHttpWebRequestTests since there is a type collision + ( Name: "SystemComponentModelDataAnnotationsTests", Assemblies: new [] { "xammac_net_4_5_System.ComponentModel.DataAnnotations_test.dll" }), + ( Name: "SystemCoreTests", Assemblies: new [] { "xammac_net_4_5_System.Core_test.dll" }), + ( Name: "SystemSecurityTests", Assemblies: new [] { "xammac_net_4_5_System.Security_test.dll" }), + ( Name: "SystemXmlTests", Assemblies: new [] { "xammac_net_4_5_System.Xml_test.dll" }), + ( Name: "SystemTests", Assemblies: new [] { "xammac_net_4_5_System_test.dll" }), + ( Name: "MonoCSharpTests", Assemblies: new [] { "xammac_net_4_5_Mono.CSharp_test.dll" }), // if add to the first group, it blocks 'til a timeout, mono issue + }), + + ["Mac OS X BCL tests group 3"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "CorlibTests", Assemblies: new [] { "xammac_net_4_5_corlib_test.dll" }), + }), + // xUnit Projects + ["Mac OS X BCL tests group 4"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "MicrosoftCSharpXunit", Assemblies: new [] { "xammac_net_4_5_Microsoft.CSharp_xunit-test.dll" }), + ( Name: "SystemComponentModelCompositionXunit", Assemblies: new [] { "xammac_net_4_5_System.ComponentModel.Composition_xunit-test.dll" }), + ( Name: "SystemCoreXunit", Assemblies: new [] { "xammac_net_4_5_System.Core_xunit-test.dll" }), + ( Name: "SystemDataXunit", Assemblies: new [] { "xammac_net_4_5_System.Data_xunit-test.dll" }), + ( Name: "SystemJsonXunit", Assemblies: new [] { "xammac_net_4_5_System.Json_xunit-test.dll" }), + ( Name: "SystemNetHttpFunctionalTestsXunit", Assemblies: new [] { "xammac_net_4_5_System.Net.Http.FunctionalTests_xunit-test.dll" }), + ( Name: "SystemNetHttpUnitTestsXunit", Assemblies: new [] { "xammac_net_4_5_System.Net.Http.UnitTests_xunit-test.dll" }), + ( Name: "SystemNumericsXunit", Assemblies: new [] { "xammac_net_4_5_System.Numerics_xunit-test.dll" }), + ( Name: "SystemRuntimeCompilerServicesUnsafeXunit", Assemblies: new [] { "xammac_net_4_5_System.Runtime.CompilerServices.Unsafe_xunit-test.dll" }), + ( Name: "SystemSecurityXunit", Assemblies: new [] { "xammac_net_4_5_System.Security_xunit-test.dll" }), + ( Name: "SystemXmlLinqXunit", Assemblies: new [] { "xammac_net_4_5_System.Xml.Linq_xunit-test.dll" }), + ( Name: "SystemXmlXunit", Assemblies: new [] { "xammac_net_4_5_System.Xml_xunit-test.dll" }), + ( Name: "SystemXunit", Assemblies: new [] { "xammac_net_4_5_System_xunit-test.dll" }), + }), + // special testcase for the corlib which is later used in xHarness for diff config options + ["mscorlib"] = ( + ExtraArgs: null, + TimeoutMultiplier: 1, + Projects: new [] { + ( Name: "mscorlib", Assemblies: new [] { "xammac_net_4_5_corlib_xunit-test.dll" }), + }), }; public bool GroupTests { get; set; } @@ -198,42 +276,32 @@ public BCLTestProjectGenerator (string outputDirectory, string monoRootPath) : t /// has its own details. /// The dir where the projects will be saved. /// - public Task GenerateTestProjectsAsync (IEnumerable projects, Platform platform) + public Task GenerateTestProjectsAsync (IEnumerable<(string Name, string [] Assemblies, string ExtraArgs, double TimeoutMultiplier)> projects, Platform platform) => TemplatedProject.GenerateTestProjectsAsync (projects, platform); - List GetProjectDefinitions (List definitions, Platform platform) + List<(string Name, string [] Assemblies, string ExtraArgs, double TimeoutMultiplier)> GetProjectDefinitions (ProjectsDefinitions definitions, Platform platform) { - var testProjects = new List (); - if (GroupTests && platform != Platform.WatchOS) { - // build the grouped apps - var groupedApps = new Dictionary> (); - var groupedAppsExtraArgs = new Dictionary> (); - double timeoutMultiplier = 1; - foreach (var def in definitions) { - var validAssemblies = new List (); - foreach (var a in def.assemblies) { // filter ignored assemblies - if (ProjectFilter == null || !ProjectFilter.ExcludeDll (platform, a)) - validAssemblies.Add (a); - } - if (groupedApps.ContainsKey (def.Group)) { - groupedApps [def.Group].AddRange (validAssemblies); - if (def.ExtraArgs != null) - groupedAppsExtraArgs [def.Group].Add (def.ExtraArgs); - } else { - groupedApps [def.Group] = new List (validAssemblies); - groupedAppsExtraArgs [def.Group] = new List (); - if (def.ExtraArgs != null) - groupedAppsExtraArgs [def.Group].Add (def.ExtraArgs); + var testProjects = new List<(string Name, string [] Assemblies, string ExtraArgs, double TimeoutMultiplier)> (); + if (platform == Platform.WatchOS || !GroupTests) { + // go over the keys which define the groups, and split them + foreach (var groupName in definitions.Keys) { + var (ExtraArgs, TimeoutMultiplier, Projects) = definitions [groupName]; + foreach (var (Name, Assemblies) in Projects) { + testProjects.Add ((Name, Assemblies, ExtraArgs, TimeoutMultiplier)); } - timeoutMultiplier += (def.TimeoutMultiplier - 1); - } - foreach (var group in groupedApps.Keys) { - var cleanedExtraArgs = groupedAppsExtraArgs [group].Distinct (); - testProjects.Add (new BclTestProjectInfo { Name = group, assemblies = groupedApps [group].ToArray (), ExtraArgs = string.Join (" ", cleanedExtraArgs), TimeoutMultiplier = timeoutMultiplier }); } } else { - foreach (var def in definitions) { - testProjects.Add (new BclTestProjectInfo { Name = def.Name, assemblies = def.assemblies, ExtraArgs = def.ExtraArgs, TimeoutMultiplier = def.TimeoutMultiplier }); + // go over the keys, which define the groups and join all the asseblies in a single array + foreach (var groupName in definitions.Keys) { + var groupedAssemblies = new List (); + var (ExtraArgs, TimeoutMultiplier, Projects) = definitions [groupName]; + foreach (var (_, Assemblies) in Projects) { + foreach (var a in Assemblies) { + if (ProjectFilter == null || !ProjectFilter.ExcludeDll (platform, a)) + groupedAssemblies.AddRange (Assemblies); + } + } + testProjects.Add ((Name: groupName, Assemblies: groupedAssemblies.ToArray (), ExtraArgs, TimeoutMultiplier)); } } return testProjects; diff --git a/tests/xharness/BCLTestImporter/BclTestProjectInfo.cs b/tests/xharness/BCLTestImporter/BclTestProjectInfo.cs deleted file mode 100644 index f4155b48dfb7..000000000000 --- a/tests/xharness/BCLTestImporter/BclTestProjectInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -namespace Xharness.BCLTestImporter { - public class BclTestProjectInfo { - public string Name; - public string [] assemblies; - public string ExtraArgs; - public string Group; - public double TimeoutMultiplier = 1; - } -} diff --git a/tests/xharness/BCLTestImporter/Templates/ITemplatedProject.cs b/tests/xharness/BCLTestImporter/Templates/ITemplatedProject.cs index b9adf8b7e08b..a5ae2731db06 100644 --- a/tests/xharness/BCLTestImporter/Templates/ITemplatedProject.cs +++ b/tests/xharness/BCLTestImporter/Templates/ITemplatedProject.cs @@ -29,6 +29,6 @@ public interface ITemplatedProject { /// has its own details. /// The dir where the projects will be saved. /// - Task GenerateTestProjectsAsync (IEnumerable projects, Platform platform); + Task GenerateTestProjectsAsync (IEnumerable<(string Name, string [] Assemblies, string ExtraArgs, double TimeoutMultiplier)> projects, Platform platform); } } diff --git a/tests/xharness/BCLTestImporter/Templates/Managed/XamariniOSTemplate.cs b/tests/xharness/BCLTestImporter/Templates/Managed/XamariniOSTemplate.cs index c7fc97eab401..7131eb2d631f 100644 --- a/tests/xharness/BCLTestImporter/Templates/Managed/XamariniOSTemplate.cs +++ b/tests/xharness/BCLTestImporter/Templates/Managed/XamariniOSTemplate.cs @@ -311,7 +311,7 @@ string GenerateIncludeFilesNode (string projectName, (string FailureMessage, Lis return contentFiles.ToString (); } - public async Task GenerateTestProjectsAsync (IEnumerable projects, Platform platform) + public async Task GenerateTestProjectsAsync (IEnumerable<(string Name, string [] Assemblies, string ExtraArgs, double TimeoutMultiplier)> projects, Platform platform) { // generate the template c# code before we create the diff projects await GenerateSource (Path.Combine (OutputDirectoryPath, "templates")); @@ -382,7 +382,7 @@ async Task GenerateWatchExtensionAsync (string projectName, Stream templ } // internal implementations that generate each of the diff projects - async Task GenerateWatchOSTestProjectsAsync (IEnumerable projects) + async Task GenerateWatchOSTestProjectsAsync (IEnumerable<(string Name, string [] Assemblies, string ExtraArgs, double TimeoutMultiplier)> projects) { var projectPaths = new GeneratedProjects (); foreach (var def in projects) { @@ -391,7 +391,7 @@ async Task GenerateWatchOSTestProjectsAsync (IEnumerable GenerateAsync (string projectName, string registerPath, (stri } } - async Task GenerateiOSTestProjectsAsync (IEnumerable projects, Platform platform) + async Task GenerateiOSTestProjectsAsync (IEnumerable<(string Name, string [] Assemblies, string ExtraArgs, double TimeoutMultiplier)> projects, Platform platform) { if (platform == Platform.WatchOS) throw new ArgumentException (nameof (platform)); @@ -515,9 +515,9 @@ async Task GenerateiOSTestProjectsAsync (IEnumerable GenerateMacAsync (string projectName, string registerPath, (s } } - async Task GenerateMacTestProjectsAsync (IEnumerable projects, Platform platform) + async Task GenerateMacTestProjectsAsync (IEnumerable<(string Name, string [] Assemblies, string ExtraArgs, double TimeoutMultiplier)> projects, Platform platform) { var projectPaths = new GeneratedProjects (); foreach (var def in projects) { - if (!def.assemblies.Any ()) + if (!def.Assemblies.Any ()) continue; - var projectDefinition = new BCLTestProjectDefinition (def.Name, AssemblyLocator, AssemblyDefinitionFactory, def.assemblies, def.ExtraArgs); + var projectDefinition = new BCLTestProjectDefinition (def.Name, AssemblyLocator, AssemblyDefinitionFactory, def.Assemblies, def.ExtraArgs); if (ProjectFilter != null && ProjectFilter.ExludeProject (projectDefinition, platform)) continue; diff --git a/tests/xharness/Xharness.Tests/BCLTestImporter/Tests/BCLTestProjectGeneratorTest.cs b/tests/xharness/Xharness.Tests/BCLTestImporter/Tests/BCLTestProjectGeneratorTest.cs index a0ca7ebd75dd..eb61d05d89d5 100644 --- a/tests/xharness/Xharness.Tests/BCLTestImporter/Tests/BCLTestProjectGeneratorTest.cs +++ b/tests/xharness/Xharness.Tests/BCLTestImporter/Tests/BCLTestProjectGeneratorTest.cs @@ -88,20 +88,16 @@ public async Task GenerateTestProjectsAsyncTest () ( Name: "First project", Path: "", XUnit: false, ExtraArgs: "", Failure: "", TimeoutMultiplier: 1), ( Name: "Second project", Path: "", XUnit: true, ExtraArgs: "", Failure: "", TimeoutMultiplier: 1), }; - var infos = new List { - new BclTestProjectInfo { - Name = "First project", - }, - new BclTestProjectInfo { - Name = "Second project", - } + var infos = new List<(string Name, string [] Assemblies, string ExtraArgs, double TimeoutMultiplier)> { + ( Name: "First project", Assemblies: new string [] { }, ExtraArgs: "", TimeoutMultiplier: 1), + ( Name: "Second project", Assemblies: new string [] { }, ExtraArgs: "", TimeoutMultiplier: 1), }; - template.Setup (t => t.GenerateTestProjectsAsync (It.IsAny> (), It.IsAny ())).Returns (() => { + template.Setup (t => t.GenerateTestProjectsAsync (It.IsAny> (), It.IsAny ())).Returns (() => { return Task.FromResult (projects); }); var result = await generator.GenerateTestProjectsAsync (infos, Platform.iOS); Assert.AreEqual (projects.Count, result.Count); - template.Verify (t => t.GenerateTestProjectsAsync (It.IsAny> (), It.IsAny ())); + template.Verify (t => t.GenerateTestProjectsAsync (It.IsAny> (), It.IsAny ())); } } } \ No newline at end of file diff --git a/tests/xharness/xharness.csproj b/tests/xharness/xharness.csproj index 6c508906921c..e51353ee2531 100644 --- a/tests/xharness/xharness.csproj +++ b/tests/xharness/xharness.csproj @@ -163,7 +163,6 @@ -