diff --git a/src/Constants.mac.cs.in b/src/Constants.mac.cs.in index 96a727b415..ce51dbcb58 100644 --- a/src/Constants.mac.cs.in +++ b/src/Constants.mac.cs.in @@ -63,13 +63,13 @@ namespace MonoMac { public const string ScriptingBridgeLibrary = "/System/Library/Frameworks/ScriptingBridge.framework/ScriptingBridge"; public const string CoreDataLibrary = "/System/Library/Frameworks/CoreData.framework/CoreData"; public const string CoreImageLibrary = "/System/Library/Frameworks/QuartzCore.framework/Versions/A/Frameworks/CoreImage.framework/CoreImage"; - public const string CFNetworkLibrary = "/System/Library/Frameworks/CFNetwork.framework/CFNetwork"; + public const string CFNetworkLibrary = "/System/Library/Frameworks/CoreServices.framework/Frameworks/CFNetwork.framework/CFNetwork"; public const string CoreMidiLibrary = "/System/Library/Frameworks/CoreMIDI.framework/CoreMIDI"; public const string QuickLookLibrary = "/System/Library/Frameworks/QuickLook.framework/QuickLook"; public const string AVFoundationLibrary = "/System/Library/Frameworks/AVFoundation.framework/AVFoundation"; public const string AccelerateImageLibrary = "/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vImage"; - public const string CoreBluetoothLibrary = "/System/Library/Frameworks//CoreBluetooth.framework/CoreBluetooth"; + public const string CoreBluetoothLibrary = "/System/Library/Frameworks/IOBluetooth.framework/Versions/A/Frameworks/CoreBluetooth.framework/CoreBluetooth"; public const string GameKitLibrary = "/System/Library/Frameworks/GameKit.framework/GameKit"; public const string SceneKitLibrary = "/System/Library/Frameworks/SceneKit.framework/SceneKit"; public const string StoreKitLibrary = "/System/Library/Frameworks/StoreKit.framework/StoreKit"; diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index db80c307de..798f64aafb 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -1042,10 +1042,18 @@ namespace Introspection #if MONOMAC // on macOS the file should exist on the specified path // for iOS the simulator paths do not match the strings - if (!File.Exists (lib)) { - if (lib != Constants.CoreImageLibrary) + switch (lib) { + // location changed in 10.8 but it loads fine (and fixing it breaks on earlier macOS) + case Constants.CFNetworkLibrary: + // location changed in 10.10 but it loads fine (and fixing it breaks on earlier macOS) + case Constants.CoreBluetoothLibrary: + // location changed in 10.11 but it loads fine (and fixing it breaks on earlier macOS) + case Constants.CoreImageLibrary: + break; + default: + if (!File.Exists (lib)) return false; - // location changed in 10.11 but it loads fine (and fixing it breaks on earlier macOS) + break; } #endif var h = IntPtr.Zero; diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index dbb6da7981..8fd802950a 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -83,25 +83,29 @@ namespace xharness Devices.Harness = Harness; if (SimulatorLoadLog == null) - SimulatorLoadLog = Logs.Create ($"simulator-list-{Harness.Timestamp}.log", "Simulator Listing"); + SimulatorLoadLog = Logs.Create ($"simulator-list-{Harness.Timestamp}.log", "Simulator Listing (in progress)"); var simulatorLoadTask = Task.Run (async () => { try { await Simulators.LoadAsync (SimulatorLoadLog); + SimulatorLoadLog.Description = "Simulator Listing (ok)"; } catch (Exception e) { SimulatorLoadLog.WriteLine ("Failed to load simulators:"); SimulatorLoadLog.WriteLine (e); + SimulatorLoadLog.Description = $"Simulator Listing ({e.Message})"; } }); if (DeviceLoadLog == null) - DeviceLoadLog = Logs.Create ($"device-list-{Harness.Timestamp}.log", "Device Listing"); + DeviceLoadLog = Logs.Create ($"device-list-{Harness.Timestamp}.log", "Device Listing (in progress)"); var deviceLoadTask = Task.Run (async () => { try { await Devices.LoadAsync (DeviceLoadLog, removed_locked: true); + DeviceLoadLog.Description = "Device Listing (ok)"; } catch (Exception e) { DeviceLoadLog.WriteLine ("Failed to load devices:"); DeviceLoadLog.WriteLine (e); + DeviceLoadLog.Description = $"Device Listing ({e.Message})"; } }); @@ -1159,33 +1163,59 @@ namespace xharness } } break; + case "/stoptest": case "/runtest": response.ContentType = System.Net.Mime.MediaTypeNames.Text.Plain; - using (var writer = new StreamWriter (response.OutputStream)) { - int id; - var id_inputs = arguments ["id"].Split (','); - - // We want to randomize the order the tests are added, so that we don't build first the test for one device, - // then for another, since that would not take advantage of running tests on several devices in parallel. - var rnd = new Random ((int) DateTime.Now.Ticks); - id_inputs = id_inputs.OrderBy (v => rnd.Next ()).ToArray (); - + IEnumerable find_tasks (StreamWriter writer, string ids) + { + var id_inputs = ids.Split (','); foreach (var id_input in id_inputs) { - if (int.TryParse (id_input, out id)) { + if (int.TryParse (id_input, out var id)) { var task = Tasks.FirstOrDefault ((t) => t.ID == id); if (task == null) task = Tasks.Where ((v) => v is AggregatedRunSimulatorTask).Cast ().SelectMany ((v) => v.Tasks).FirstOrDefault ((t) => t.ID == id); if (task == null) { writer.WriteLine ($"Could not find test {id}"); - } else if (task.InProgress || task.Waiting) { + } else { + yield return task; + } + } else { + writer.WriteLine ($"Could not parse {arguments ["id"]}"); + } + } + + } + using (var writer = new StreamWriter (response.OutputStream)) { + var id_inputs = arguments ["id"].Split (','); + + var tasks = find_tasks (writer, arguments ["id"]); + + // We want to randomize the order the tests are added, so that we don't build first the test for one device, + // then for another, since that would not take advantage of running tests on several devices in parallel. + var rnd = new Random ((int) DateTime.Now.Ticks); + tasks = tasks.OrderBy ((v) => rnd.Next ()); + + foreach (var task in tasks) { + switch (request.Url.LocalPath) { + case "/stoptest": + if (!task.Waiting) { + writer.WriteLine ($"Test '{task.TestName}' is not in a waiting state."); + } else { + task.Reset (); + writer.WriteLine ($"OK: {task.ID}"); + } + break; + case "/runtest": + if (task.InProgress || task.Waiting) { writer.WriteLine ($"Test '{task.TestName}' is already executing."); } else { task.Reset (); task.RunAsync (); - writer.WriteLine ("OK"); + writer.WriteLine ($"OK: {task.ID}"); } - } else { - writer.WriteLine ($"Could not parse {arguments ["id"]}"); + break; + default: + throw new NotImplementedException (); } } } @@ -1630,6 +1660,10 @@ function runtest(id) { sendrequest (""runtest?id="" + id); } +function stoptest(id) +{ + sendrequest (""stoptest?id="" + id); +} function sendrequest(url, callback) { var xhttp = new XMLHttpRequest(); @@ -1758,7 +1792,7 @@ function toggleAll (show) writer.WriteLine ("

Test results

"); foreach (var log in Logs) - writer.WriteLine ("{1}
", log.FullPath.Substring (LogDirectory.Length + 1), log.Description); + writer.WriteLine (" {1}
", log.FullPath.Substring (LogDirectory.Length + 1), log.Description, id_counter++); var headerColor = "black"; if (unfinishedTests.Any ()) { @@ -1989,8 +2023,17 @@ function toggleAll (show) writer.Write ($"
"); writer.Write ($"{defaultExpander}"); writer.Write ($"{title} ({state}) "); - if (IsServerMode && !test.InProgress && !test.Waiting) - writer.Write ($" Run "); + if (IsServerMode) { + writer.Write ($" "); + if (test.Waiting) { + writer.Write ($" Stop "); + } else if (test.InProgress) { + // Stopping is not implemented for tasks that are already executing + } else { + writer.Write ($" Run "); + } + writer.Write (" "); + } writer.WriteLine ("
"); writer.WriteLine ($"
"); diff --git a/tools/mmp/Makefile b/tools/mmp/Makefile index 0cc6869eb5..de5437d9c9 100644 --- a/tools/mmp/Makefile +++ b/tools/mmp/Makefile @@ -1,6 +1,8 @@ TOP=../.. include $(TOP)/Make.config +export DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) + # # mmp #