A game about forced loneliness, made by TACStudios
1using System;
2using System.Collections;
3using System.Linq;
4using UnityEditor.TestTools.TestRunner.UnityTestProtocol;
5using UnityEngine;
6using UnityEngine.TestRunner.NUnitExtensions.Runner;
7using UnityEngine.TestTools;
8
9namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
10{
11 internal class GenerateContextTask : TestTaskBase
12 {
13 public GenerateContextTask()
14 {
15 RerunAfterResume = true;
16 }
17
18 public override IEnumerator Execute(TestJobData testJobData)
19 {
20 if (testJobData.taskInfoStack.Peek().taskMode == TaskMode.Normal)
21 {
22 testJobData.setUpTearDownState = new BeforeAfterTestCommandState();
23 testJobData.outerUnityTestActionState = new BeforeAfterTestCommandState();
24 testJobData.enumerableTestState = new EnumerableTestState();
25 }
26
27 testJobData.Context = new UnityTestExecutionContext()
28 {
29 SetUpTearDownState = testJobData.setUpTearDownState,
30 OuterUnityTestActionState = testJobData.outerUnityTestActionState,
31 EnumerableTestState = testJobData.enumerableTestState,
32 Automated = UnityTestProtocolStarter.IsEnabled(),
33 RetryCount = testJobData.executionSettings.retryCount,
34 RepeatCount = testJobData.executionSettings.repeatCount,
35 RetryRepeatState = testJobData.RetryRepeatState
36 };
37
38 if (testJobData.executionSettings.ignoreTests != null)
39 {
40 testJobData.Context.IgnoreTests = testJobData.executionSettings.ignoreTests.Select(ignoreTest => ignoreTest.ParseToEngine()).ToArray();
41 }
42
43 testJobData.Context.FeatureFlags = testJobData.executionSettings.featureFlags;
44
45 UnityTestExecutionContext.CurrentContext = testJobData.Context;
46
47 yield break;
48 }
49 }
50}