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

26 lines
828 B
C#
Raw Permalink Normal View History

2024-05-06 14:45:45 -04: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.ToRuntimeTestRunnerFilter(testJobData.executionSettings.runSynchronously)).ToArray());
var launcher = new PlaymodeLauncher(settings);
launcher.Run();
while (PlaymodeLauncher.IsRunning)
{
yield return null;
}
}
}
}