GlobalGameJame/Library/PackageCache/com.unity.test-framework@1.1.9/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayModeRunTask.cs

26 lines
775 B
C#
Raw Normal View History

2020-01-31 15:10:04 +00:00
using System.Collections;
using System.Linq;
using UnityEngine.TestTools.TestRunner;
namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
{
internal class LegacyPlayModeRunTask : TestTaskBase
{
public LegacyPlayModeRunTask() : base(true)
{
}
public override IEnumerator Execute(TestJobData testJobData)
{
var settings = PlaymodeTestsControllerSettings.CreateRunnerSettings(testJobData.executionSettings.filters.Select(filter => filter.ToTestRunnerFilter()).ToArray());
var launcher = new PlaymodeLauncher(settings);
launcher.Run();
while (PlaymodeLauncher.IsRunning)
{
yield return null;
}
}
}
}