diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 88829b54dd89..fa67c59abd40 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -2708,7 +2708,7 @@ protected override async Task ExecuteAsync () xbuild.StartInfo.EnvironmentVariables ["MSBuildExtensionsPath"] = null; LogEvent (log, "Building {0} ({1})", TestName, Mode); if (!Harness.DryRun) { - var timeout = TimeSpan.FromMinutes (15); + var timeout = TimeSpan.FromMinutes (60); var result = await xbuild.RunAsync (log, true, timeout); if (result.TimedOut) { ExecutionResult = TestExecutingResult.TimedOut; diff --git a/tests/xharness/ProjectFileExtensions.cs b/tests/xharness/ProjectFileExtensions.cs index 5c932099bd60..e5bf9e9558dc 100644 --- a/tests/xharness/ProjectFileExtensions.cs +++ b/tests/xharness/ProjectFileExtensions.cs @@ -380,6 +380,11 @@ public static string GetExtraMtouchArgs (this XmlDocument csproj, string platfor return string.Empty; } + public static string GetMtouchLink (this XmlDocument csproj, string platform, string configuration) + { + return GetNode (csproj, "MtouchLink", platform, configuration); + } + public static void SetMtouchUseLlvm (this XmlDocument csproj, bool value, string platform, string configuration) { SetNode (csproj, "MtouchUseLlvm", true ? "true" : "false", platform, configuration); @@ -390,6 +395,17 @@ public static void SetMtouchUseBitcode (this XmlDocument csproj, bool value, str SetNode (csproj, "MtouchEnableBitcode", true ? "true" : "false", platform, configuration); } + public static IEnumerable GetPropertyGroups (this XmlDocument csproj, string platform, string configuration) + { + var propertyGroups = csproj.SelectNodes ("//*[local-name() = 'PropertyGroup' and @Condition]"); + foreach (XmlNode node in propertyGroups) { + if (!EvaluateCondition (node, platform, configuration)) + continue; + + yield return node; + } + } + public static void SetNode (this XmlDocument csproj, string node, string value, string platform, string configuration) { var projnode = csproj.SelectElementNodes (node); @@ -417,6 +433,16 @@ public static void SetNode (this XmlDocument csproj, string node, string value, } } + public static string GetNode (this XmlDocument csproj, string name, string platform, string configuration) + { + foreach (var pg in GetPropertyGroups (csproj, platform, configuration)) { + foreach (XmlNode node in pg.ChildNodes) + if (node.Name == name) + return node.InnerText; + } + + return null; + } public static string GetImport (this XmlDocument csproj) { diff --git a/tests/xharness/WatchOSTarget.cs b/tests/xharness/WatchOSTarget.cs index 0776cea0e395..6cb67e0638e4 100644 --- a/tests/xharness/WatchOSTarget.cs +++ b/tests/xharness/WatchOSTarget.cs @@ -84,6 +84,13 @@ void CreateWatchOSExtensionProject () csproj.SetMtouchUseBitcode (true, "iPhone", "Release"); csproj.SetMtouchUseLlvm (true, "iPhone", "Release"); + // Not linking a watch extensions requires passing -Os to the native compiler. + // https://github.com/mono/mono/issues/9867 + var configurations = new string [] { "Debug", "Debug32", "Release", "Release32", "Release-bitcode" }; + foreach (var c in configurations) + if (csproj.GetMtouchLink ("iPhone", c) == "None") + csproj.AddExtraMtouchArgs ("--gcc_flags=-Os", "iPhone", c); + Harness.Save (csproj, WatchOSExtensionProjectPath); WatchOSExtensionGuid = csproj.GetProjectGuid ();