[xharness] Don't throw NRE if a simulator doesn't exist.

We automatically create simulators when needed, but it won't work if the
simulator runtime isn't installed. So handle the case where a test might not
have a simulator to execute in correctly.
This commit is contained in:
Rolf Bjarne Kvinge 2018-10-29 11:56:53 +01:00
Родитель 80d69516ae
Коммит f53f602590
2 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -503,7 +503,7 @@ namespace xharness
await tv.FindSimulatorAsync (); await tv.FindSimulatorAsync ();
var rv = new List<AggregatedRunSimulatorTask> (); var rv = new List<AggregatedRunSimulatorTask> ();
foreach (var taskGroup in testVariations.GroupBy ((RunSimulatorTask task) => task.Device.UDID)) { foreach (var taskGroup in testVariations.GroupBy ((RunSimulatorTask task) => task.Device?.UDID ?? task.Candidates.ToString ())) {
rv.Add (new AggregatedRunSimulatorTask (taskGroup) { rv.Add (new AggregatedRunSimulatorTask (taskGroup) {
Jenkins = this, Jenkins = this,
TestName = $"Tests for {taskGroup.Key}", TestName = $"Tests for {taskGroup.Key}",

Просмотреть файл

@ -352,6 +352,11 @@ namespace xharness
object lock_obj = new object (); object lock_obj = new object ();
Task<SimDevice []> findTask; Task<SimDevice []> findTask;
public override string ToString ()
{
return $"Simulators for {Target} (MinVersion: {MinVersion})";
}
public IEnumerator<SimDevice> GetEnumerator () public IEnumerator<SimDevice> GetEnumerator ()
{ {
return new Enumerator () return new Enumerator ()