Merge remote-tracking branch 'upstream/master' into mono-2019-02
This commit is contained in:
Коммит
b23e775fbc
|
@ -655,7 +655,7 @@ timestamps {
|
||||||
uploadFiles ("tests/*.zip", "wrench", virtualPath)
|
uploadFiles ("tests/*.zip", "wrench", virtualPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout (time: 6, unit: 'HOURS') {
|
timeout (time: 8, unit: 'HOURS') {
|
||||||
// We run tests locally and on older macOS bots in parallel.
|
// We run tests locally and on older macOS bots in parallel.
|
||||||
// The older macOS tests run quickly (and the bots should usually be idle),
|
// The older macOS tests run quickly (and the bots should usually be idle),
|
||||||
// which means that the much longer normal (local) test run should take
|
// which means that the much longer normal (local) test run should take
|
||||||
|
|
|
@ -10,8 +10,8 @@ namespace BCLTestImporter {
|
||||||
static string partialPath = "mcs/class/lib";
|
static string partialPath = "mcs/class/lib";
|
||||||
static Dictionary <Platform, string> platformPathMatch = new Dictionary <Platform, string> {
|
static Dictionary <Platform, string> platformPathMatch = new Dictionary <Platform, string> {
|
||||||
{Platform.iOS, "monotouch"},
|
{Platform.iOS, "monotouch"},
|
||||||
{Platform.WatchOS, "monotouch"},
|
{Platform.WatchOS, "monotouch_watch"},
|
||||||
{Platform.TvOS, "monotouch"},
|
{Platform.TvOS, "monotouch_tv"},
|
||||||
{Platform.MacOSFull, "xammac_net_4_5"},
|
{Platform.MacOSFull, "xammac_net_4_5"},
|
||||||
{Platform.MacOSModern, "xammac_net_4_5"},
|
{Platform.MacOSModern, "xammac_net_4_5"},
|
||||||
};
|
};
|
||||||
|
@ -32,6 +32,18 @@ namespace BCLTestImporter {
|
||||||
IsXUnit = name.Contains ("_xunit-test");
|
IsXUnit = name.Contains ("_xunit-test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetName (Platform platform)
|
||||||
|
{
|
||||||
|
switch (platform) {
|
||||||
|
case Platform.WatchOS:
|
||||||
|
return Name.Replace ("monotouch_", "monotouch_watch_");
|
||||||
|
case Platform.TvOS:
|
||||||
|
return Name.Replace ("monotouch_", "monotouch_tv_");
|
||||||
|
default:
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the mono directory where test can be found.
|
/// Returns the mono directory where test can be found.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -76,7 +88,7 @@ namespace BCLTestImporter {
|
||||||
{
|
{
|
||||||
var testsRootPath = wasDownloaded? GetTestDirectoryFromDownloadsPath (rootPath, platform) :
|
var testsRootPath = wasDownloaded? GetTestDirectoryFromDownloadsPath (rootPath, platform) :
|
||||||
GetTestDirectoryFromMonoPath (rootPath, platform);
|
GetTestDirectoryFromMonoPath (rootPath, platform);
|
||||||
return Path.Combine (testsRootPath, Name);
|
return Path.Combine (testsRootPath, GetName (platform));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -131,7 +131,7 @@ namespace BCLTestImporter {
|
||||||
a => (assembly: a,
|
a => (assembly: a,
|
||||||
hintPath: BCLTestAssemblyDefinition.GetHintPathForRefenreceAssembly (a, monoRootPath, platform))).Union (
|
hintPath: BCLTestAssemblyDefinition.GetHintPathForRefenreceAssembly (a, monoRootPath, platform))).Union (
|
||||||
TestAssemblies.Select (
|
TestAssemblies.Select (
|
||||||
definition => (assembly: definition.Name,
|
definition => (assembly: definition.GetName (platform),
|
||||||
hintPath: definition.GetPath (monoRootPath, platform, wasDownloaded))))
|
hintPath: definition.GetPath (monoRootPath, platform, wasDownloaded))))
|
||||||
.ToList ();
|
.ToList ();
|
||||||
|
|
||||||
|
|
|
@ -147,6 +147,7 @@ namespace BCLTestImporter {
|
||||||
|
|
||||||
static readonly List<string> watcOSIgnoredAssemblies = new List<string> {
|
static readonly List<string> watcOSIgnoredAssemblies = new List<string> {
|
||||||
"monotouch_Mono.Security_test.dll",
|
"monotouch_Mono.Security_test.dll",
|
||||||
|
"monotouch_Mono.Data.Tds_test.dll", // not present in the watch tests dlls
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly List<(string name, string[] assemblies, string group)> macTestProjects = new List<(string name, string[] assemblies, string group)> {
|
private static readonly List<(string name, string[] assemblies, string group)> macTestProjects = new List<(string name, string[] assemblies, string group)> {
|
||||||
|
@ -356,7 +357,17 @@ namespace BCLTestImporter {
|
||||||
return sb.ToString ();
|
return sb.ToString ();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string GetCommonIgnoreFileName (string projectName) => $"common-{projectName}.ignore";
|
internal static string GetCommonIgnoreFileName (string name, Platform platform)
|
||||||
|
{
|
||||||
|
switch (platform) {
|
||||||
|
case Platform.TvOS:
|
||||||
|
return $"common-{name.Replace ("monotouch_tv_", "monotouch_")}.ignore";
|
||||||
|
case Platform.WatchOS:
|
||||||
|
return $"common-{name.Replace ("monotouch_watch_", "monotouch_")}.ignore";
|
||||||
|
default:
|
||||||
|
return $"common-{name}.ignore";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal static string[] GetIgnoreFileNames (string name, Platform platform)
|
internal static string[] GetIgnoreFileNames (string name, Platform platform)
|
||||||
{
|
{
|
||||||
|
@ -368,20 +379,19 @@ namespace BCLTestImporter {
|
||||||
case Platform.MacOSModern:
|
case Platform.MacOSModern:
|
||||||
return new string [] { $"macOSModern-{name}.ignore", $"macOS-{name}.ignore" };
|
return new string [] { $"macOSModern-{name}.ignore", $"macOS-{name}.ignore" };
|
||||||
case Platform.TvOS:
|
case Platform.TvOS:
|
||||||
return new string [] { $"tvOS-{name}.ignore" };
|
return new string [] { $"tvOS-{name.Replace ("monotouch_tv_", "monotouch_")}.ignore" };
|
||||||
case Platform.WatchOS:
|
case Platform.WatchOS:
|
||||||
return new string [] { $"watchOS-{name}.ignore" };
|
return new string [] { $"watchOS-{name.Replace ("monotouch_watch_", "monotouch_")}.ignore" };
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static IEnumerable<string> GetIgnoreFiles (string templatePath, string projectName, List<(string assembly, string hintPath)> assemblies, Platform platform)
|
internal static IEnumerable<string> GetIgnoreFiles (string templatePath, string projectName, List<(string assembly, string hintPath)> assemblies, Platform platform)
|
||||||
{
|
{
|
||||||
// check if the common and plaform paths can be found in the template path, if they are, we return them
|
// check if the common and plaform paths can be found in the template path, if they are, we return them
|
||||||
var templateDir = Path.GetDirectoryName (templatePath);
|
var templateDir = Path.GetDirectoryName (templatePath);
|
||||||
var commonIgnore = Path.Combine (templateDir, GetCommonIgnoreFileName (projectName));
|
var commonIgnore = Path.Combine (templateDir, GetCommonIgnoreFileName (projectName, platform));
|
||||||
if (File.Exists (commonIgnore))
|
if (File.Exists (commonIgnore))
|
||||||
yield return commonIgnore;
|
yield return commonIgnore;
|
||||||
foreach (var platformFile in GetIgnoreFileNames (projectName, platform)) {
|
foreach (var platformFile in GetIgnoreFileNames (projectName, platform)) {
|
||||||
|
@ -392,7 +402,7 @@ namespace BCLTestImporter {
|
||||||
// do we have ignores per files and not the project name? Add them
|
// do we have ignores per files and not the project name? Add them
|
||||||
foreach (var (assembly, hintPath) in assemblies) {
|
foreach (var (assembly, hintPath) in assemblies) {
|
||||||
foreach (var platformFile in GetIgnoreFileNames (assembly, platform)) {
|
foreach (var platformFile in GetIgnoreFileNames (assembly, platform)) {
|
||||||
var commonAssemblyIgnore = Path.Combine (templateDir, GetCommonIgnoreFileName (assembly));
|
var commonAssemblyIgnore = Path.Combine (templateDir, GetCommonIgnoreFileName (assembly, platform));
|
||||||
if (File.Exists (commonAssemblyIgnore))
|
if (File.Exists (commonAssemblyIgnore))
|
||||||
yield return commonAssemblyIgnore;
|
yield return commonAssemblyIgnore;
|
||||||
var platformAssemblyIgnore = Path.Combine (templateDir, platformFile);
|
var platformAssemblyIgnore = Path.Combine (templateDir, platformFile);
|
||||||
|
@ -465,7 +475,7 @@ namespace BCLTestImporter {
|
||||||
|
|
||||||
if (!projectDefinition.Validate ())
|
if (!projectDefinition.Validate ())
|
||||||
throw new InvalidOperationException ("xUnit and NUnit assemblies cannot be mixed in a test project.");
|
throw new InvalidOperationException ("xUnit and NUnit assemblies cannot be mixed in a test project.");
|
||||||
var generatedCodeDir = Path.Combine (generatedDir, projectDefinition.Name);
|
var generatedCodeDir = Path.Combine (generatedDir, projectDefinition.Name, "watch");
|
||||||
if (!Directory.Exists (generatedCodeDir)) {
|
if (!Directory.Exists (generatedCodeDir)) {
|
||||||
Directory.CreateDirectory (generatedCodeDir);
|
Directory.CreateDirectory (generatedCodeDir);
|
||||||
}
|
}
|
||||||
|
@ -550,7 +560,7 @@ namespace BCLTestImporter {
|
||||||
if (!projectDefinition.Validate ())
|
if (!projectDefinition.Validate ())
|
||||||
throw new InvalidOperationException ("xUnit and NUnit assemblies cannot be mixed in a test project.");
|
throw new InvalidOperationException ("xUnit and NUnit assemblies cannot be mixed in a test project.");
|
||||||
// generate the required type registration info
|
// generate the required type registration info
|
||||||
var generatedCodeDir = Path.Combine (generatedDir, projectDefinition.Name);
|
var generatedCodeDir = Path.Combine (generatedDir, projectDefinition.Name, (platform == Platform.iOS)?"ios": "tv");
|
||||||
if (!Directory.Exists (generatedCodeDir)) {
|
if (!Directory.Exists (generatedCodeDir)) {
|
||||||
Directory.CreateDirectory (generatedCodeDir);
|
Directory.CreateDirectory (generatedCodeDir);
|
||||||
}
|
}
|
||||||
|
@ -572,7 +582,7 @@ namespace BCLTestImporter {
|
||||||
using (var file = new StreamWriter (projectPath, false)) { // false is do not append
|
using (var file = new StreamWriter (projectPath, false)) { // false is do not append
|
||||||
await file.WriteAsync (generatedProject);
|
await file.WriteAsync (generatedProject);
|
||||||
}
|
}
|
||||||
var typesPerAssembly = projectDefinition.GetTypeForAssemblies (GetReleaseDownload (Platform.iOS), Platform.iOS, true);
|
var typesPerAssembly = projectDefinition.GetTypeForAssemblies (GetReleaseDownload (Platform.iOS), platform, true);
|
||||||
var registerCode = await RegisterTypeGenerator.GenerateCodeAsync (typesPerAssembly,
|
var registerCode = await RegisterTypeGenerator.GenerateCodeAsync (typesPerAssembly,
|
||||||
projectDefinition.IsXUnit, RegisterTypesTemplatePath);
|
projectDefinition.IsXUnit, RegisterTypesTemplatePath);
|
||||||
|
|
||||||
|
@ -603,7 +613,7 @@ namespace BCLTestImporter {
|
||||||
if (!projectDefinition.Validate ())
|
if (!projectDefinition.Validate ())
|
||||||
throw new InvalidOperationException ("xUnit and NUnit assemblies cannot be mixed in a test project.");
|
throw new InvalidOperationException ("xUnit and NUnit assemblies cannot be mixed in a test project.");
|
||||||
// generate the required type registration info
|
// generate the required type registration info
|
||||||
var generatedCodeDir = Path.Combine (generatedDir, projectDefinition.Name);
|
var generatedCodeDir = Path.Combine (generatedDir, projectDefinition.Name, "mac");
|
||||||
Directory.CreateDirectory (generatedCodeDir);
|
Directory.CreateDirectory (generatedCodeDir);
|
||||||
var registerTypePath = Path.Combine (generatedCodeDir, "RegisterType-mac.cs");
|
var registerTypePath = Path.Combine (generatedCodeDir, "RegisterType-mac.cs");
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче