diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
| commit | c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 (patch) | |
| tree | ee4d51c7c1d633e11f46453ef1edd3c77c4ef9f7 /Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks | |
| download | Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.gz Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.bz2 Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.zip | |
Inital commit
Diffstat (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks')
26 files changed, 546 insertions, 0 deletions
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildActionTaskBase.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildActionTaskBase.cs new file mode 100644 index 0000000..016ea54 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildActionTaskBase.cs @@ -0,0 +1,86 @@ +using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using NUnit.Framework.Interfaces;
+using UnityEngine;
+using UnityEngine.TestTools.Logging;
+using UnityEngine.TestTools.TestRunner;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal abstract class BuildActionTaskBase<T> : TestTaskBase
+ {
+ private string typeName;
+ internal IAttributeFinder attributeFinder;
+ internal RuntimePlatform targetPlatform = Application.platform;
+ internal Action<string> logAction = Debug.Log;
+ internal Func<ILogScope> logScopeProvider = () => new LogScope();
+ internal Func<Type, object> createInstance = Activator.CreateInstance;
+
+ protected BuildActionTaskBase(IAttributeFinder attributeFinder)
+ {
+ this.attributeFinder = attributeFinder;
+ typeName = typeof(T).Name;
+ }
+
+ protected abstract void Action(T target);
+
+ public override IEnumerator Execute(TestJobData testJobData)
+ {
+ if (testJobData.testTree == null)
+ {
+ throw new Exception($"Test tree is not available for {GetType().Name}.");
+ }
+
+ var enumerator = ExecuteMethods(testJobData.testTree, testJobData.executionSettings.BuildNUnitFilter());
+ while (enumerator.MoveNext())
+ {
+ yield return null;
+ }
+ }
+
+ protected IEnumerator ExecuteMethods(ITest testTree, ITestFilter testRunnerFilter)
+ {
+ var exceptions = new List<Exception>();
+
+ foreach (var targetClassType in attributeFinder.Search(testTree, testRunnerFilter, targetPlatform))
+ {
+ try
+ {
+ var targetClass = (T) createInstance(targetClassType);
+
+ logAction($"Executing {typeName} for: {targetClassType.FullName}.");
+
+ using (var logScope = logScopeProvider())
+ {
+ Action(targetClass);
+
+ if (logScope.AnyFailingLogs())
+ {
+ var failingLog = logScope.FailingLogs.First();
+ throw new UnhandledLogMessageException(failingLog);
+ }
+
+ if (logScope.ExpectedLogs.Any())
+ {
+ var expectedLogs = logScope.ExpectedLogs.First();
+ throw new UnexpectedLogMessageException(expectedLogs);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ exceptions.Add(ex);
+ }
+
+ yield return null;
+ }
+
+ if (exceptions.Count > 0)
+ {
+ throw new AggregateException($"One or more exceptions when executing {typeName}.", exceptions);
+ }
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildActionTaskBase.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildActionTaskBase.cs.meta new file mode 100644 index 0000000..e4fd79f --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildActionTaskBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: c2441d353f9c42a44af6e224e4901b52
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildTestTreeTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildTestTreeTask.cs new file mode 100644 index 0000000..fa45752 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildTestTreeTask.cs @@ -0,0 +1,61 @@ +using System;
+using System.Collections;
+using System.Linq;
+using UnityEditor.TestTools.TestRunner.Api;
+using UnityEngine.TestRunner.NUnitExtensions;
+using UnityEngine.TestTools;
+using UnityEngine.TestTools.NUnitExtensions;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal class BuildTestTreeTask : TestTaskBase
+ {
+ private TestPlatform m_TestPlatform;
+
+ public BuildTestTreeTask(TestPlatform testPlatform)
+ {
+ m_TestPlatform = testPlatform;
+ }
+
+ internal IEditorLoadedTestAssemblyProvider m_testAssemblyProvider = new EditorLoadedTestAssemblyProvider(new EditorCompilationInterfaceProxy(), new EditorAssembliesProxy());
+ internal IAsyncTestAssemblyBuilder m_testAssemblyBuilder = new UnityTestAssemblyBuilder();
+ internal ICallbacksDelegator m_CallbacksDelegator = CallbacksDelegator.instance;
+
+ public override IEnumerator Execute(TestJobData testJobData)
+ {
+ if (testJobData.testTree != null)
+ {
+ yield break;
+ }
+
+ var assembliesEnumerator = m_testAssemblyProvider.GetAssembliesGroupedByTypeAsync(m_TestPlatform);
+ while (assembliesEnumerator.MoveNext())
+ {
+ yield return null;
+ }
+
+ if (assembliesEnumerator.Current == null)
+ {
+ throw new Exception("Assemblies not retrieved.");
+ }
+
+ var assemblies = assembliesEnumerator.Current.Where(pair => m_TestPlatform.IsFlagIncluded(pair.Key)).SelectMany(pair => pair.Value).Select(x => x.Assembly).ToArray();
+ var buildSettings = UnityTestAssemblyBuilder.GetNUnitTestBuilderSettings(m_TestPlatform);
+ var enumerator = m_testAssemblyBuilder.BuildAsync(assemblies, Enumerable.Repeat(m_TestPlatform, assemblies.Length).ToArray(), buildSettings);
+ while (enumerator.MoveNext())
+ {
+ yield return null;
+ }
+
+ var testList = enumerator.Current;
+ if (testList== null)
+ {
+ throw new Exception("Test list not retrieved.");
+ }
+
+ testList.ParseForNameDuplicates();
+ testJobData.testTree = testList;
+ m_CallbacksDelegator.TestTreeRebuild(testList);
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildTestTreeTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildTestTreeTask.cs.meta new file mode 100644 index 0000000..ff4c0f7 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/BuildTestTreeTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: a0288e1c9324e824bab7e2044a72a434
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/CleanupVerificationTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/CleanupVerificationTask.cs new file mode 100644 index 0000000..3da9a30 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/CleanupVerificationTask.cs @@ -0,0 +1,47 @@ +using System;
+using System.Collections;
+using System.IO;
+using System.Linq;
+using UnityEngine;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal class CleanupVerificationTask : FileCleanupVerifierTaskBase
+ {
+ private const string k_Indent = " ";
+
+ internal Action<object> logAction = Debug.LogWarning;
+
+ public override IEnumerator Execute(TestJobData testJobData)
+ {
+ var currentFiles = GetAllFilesInAssetsDirectory();
+ var existingFiles = testJobData.existingFiles;
+
+ if (currentFiles.Length != existingFiles.Length)
+ {
+ LogWarningForFilesIfAny(currentFiles.Where(file => !testJobData.existingFiles.Contains(file)).ToArray());
+ }
+
+ yield return null;
+ }
+
+ private void LogWarningForFilesIfAny(string[] filePaths)
+ {
+ if (!filePaths.Any())
+ {
+ return;
+ }
+
+ var stringWriter = new StringWriter();
+ stringWriter.WriteLine("Files generated by test without cleanup.");
+ stringWriter.WriteLine(k_Indent + "Found {0} new files.", filePaths.Length);
+
+ foreach (var filePath in filePaths)
+ {
+ stringWriter.WriteLine(k_Indent + filePath);
+ }
+
+ logAction(stringWriter.ToString());
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/CleanupVerificationTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/CleanupVerificationTask.cs.meta new file mode 100644 index 0000000..749b832 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/CleanupVerificationTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: 93eb6389f4fb6924987867ce0bc339ee
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/FileCleanupVerifierTaskBase.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/FileCleanupVerifierTaskBase.cs new file mode 100644 index 0000000..18dc47b --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/FileCleanupVerifierTaskBase.cs @@ -0,0 +1,14 @@ +using System;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal abstract class FileCleanupVerifierTaskBase : TestTaskBase
+ {
+ internal Func<string[]> GetAllAssetPathsAction = AssetDatabase.GetAllAssetPaths;
+
+ protected string[] GetAllFilesInAssetsDirectory()
+ {
+ return GetAllAssetPathsAction();
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/FileCleanupVerifierTaskBase.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/FileCleanupVerifierTaskBase.cs.meta new file mode 100644 index 0000000..64b8002 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/FileCleanupVerifierTaskBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: ad7bb166069f8414e9ad26606b305e66
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyEditModeRunTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyEditModeRunTask.cs new file mode 100644 index 0000000..2186048 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyEditModeRunTask.cs @@ -0,0 +1,26 @@ +using System.Collections;
+using UnityEngine;
+using UnityEngine.TestTools;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal class LegacyEditModeRunTask : TestTaskBase
+ {
+ public LegacyEditModeRunTask() : base(true)
+ {
+
+ }
+
+ public override IEnumerator Execute(TestJobData testJobData)
+ {
+ var testLauncher = new EditModeLauncher(testJobData.executionSettings.filters, TestPlatform.EditMode, testJobData.executionSettings.runSynchronously);
+ testJobData.editModeRunner = testLauncher.m_EditModeRunner;
+ testLauncher.Run();
+
+ while (testJobData.editModeRunner != null && !testJobData.editModeRunner.RunFinished)
+ {
+ yield return null;
+ }
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyEditModeRunTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyEditModeRunTask.cs.meta new file mode 100644 index 0000000..a4f66d6 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyEditModeRunTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: b4246555189b5ee43b4857220f9fd29b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayModeRunTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayModeRunTask.cs new file mode 100644 index 0000000..1be2a80 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayModeRunTask.cs @@ -0,0 +1,26 @@ +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;
+ }
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayModeRunTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayModeRunTask.cs.meta new file mode 100644 index 0000000..f37f78d --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayModeRunTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: 4769fe1e7475c8843b092338acbcad25
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayerRunTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayerRunTask.cs new file mode 100644 index 0000000..7ee1913 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayerRunTask.cs @@ -0,0 +1,18 @@ +using System.Collections;
+using System.Linq;
+using UnityEngine.TestTools.TestRunner;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal class LegacyPlayerRunTask : TestTaskBase
+ {
+ public override IEnumerator Execute(TestJobData testJobData)
+ {
+ var executionSettings = testJobData.executionSettings;
+ var settings = PlaymodeTestsControllerSettings.CreateRunnerSettings(executionSettings.filters.Select(filter => filter.ToTestRunnerFilter()).ToArray());
+ var launcher = new PlayerLauncher(settings, executionSettings.targetPlatform, executionSettings.overloadTestRunSettings, executionSettings.playerHeartbeatTimeout);
+ launcher.Run();
+ yield return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayerRunTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayerRunTask.cs.meta new file mode 100644 index 0000000..e2046bb --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/LegacyPlayerRunTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: b93fe5bbea454ae438fcec241c5fa85b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PerformUndoTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PerformUndoTask.cs new file mode 100644 index 0000000..df64442 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PerformUndoTask.cs @@ -0,0 +1,39 @@ +using System;
+using System.Collections;
+using UnityEngine;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal class PerformUndoTask : TestTaskBase
+ {
+ private const double warningThreshold = 1000;
+
+ internal Action<int> RevertAllDownToGroup = Undo.RevertAllDownToGroup;
+ internal Action<string> LogWarning = Debug.LogWarning;
+ internal Action<string, string, float> DisplayProgressBar = EditorUtility.DisplayProgressBar;
+ internal Action ClearProgressBar = EditorUtility.ClearProgressBar;
+ internal Func<DateTime> TimeNow = () => DateTime.Now;
+
+ public override IEnumerator Execute(TestJobData testJobData)
+ {
+ if (testJobData.undoGroup < 0)
+ {
+ yield break;
+ }
+
+ DisplayProgressBar("Undo", "Reverting changes to the scene", 0);
+
+ var undoStartTime = TimeNow();
+
+ RevertAllDownToGroup(testJobData.undoGroup);
+
+ var timeDelta = TimeNow() - undoStartTime;
+ if (timeDelta.TotalMilliseconds >= warningThreshold)
+ {
+ LogWarning($"Undo after editor test run took {timeDelta.Seconds} second{(timeDelta.Seconds == 1 ? "" : "s")}.");
+ }
+
+ ClearProgressBar();
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PerformUndoTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PerformUndoTask.cs.meta new file mode 100644 index 0000000..be55331 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PerformUndoTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: fb1abebffd37bd4458c84e15a5d7ab04
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PrebuildSetupTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PrebuildSetupTask.cs new file mode 100644 index 0000000..34e03e3 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PrebuildSetupTask.cs @@ -0,0 +1,20 @@ +using System;
+using System.Collections;
+using NUnit.Framework.Interfaces;
+using UnityEngine;
+using UnityEngine.TestTools;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal class PrebuildSetupTask : BuildActionTaskBase<IPrebuildSetup>
+ {
+ public PrebuildSetupTask() : base(new PrebuildSetupAttributeFinder())
+ {
+ }
+
+ protected override void Action(IPrebuildSetup target)
+ {
+ target.Setup();
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PrebuildSetupTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PrebuildSetupTask.cs.meta new file mode 100644 index 0000000..009894d --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/PrebuildSetupTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: fc039194235714f48a39bd364885e744
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/RegisterFilesForCleanupVerificationTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/RegisterFilesForCleanupVerificationTask.cs new file mode 100644 index 0000000..7a4cf64 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/RegisterFilesForCleanupVerificationTask.cs @@ -0,0 +1,13 @@ +using System.Collections;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal class RegisterFilesForCleanupVerificationTask : FileCleanupVerifierTaskBase
+ {
+ public override IEnumerator Execute(TestJobData testJobData)
+ {
+ testJobData.existingFiles = GetAllFilesInAssetsDirectory();
+ yield return null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/RegisterFilesForCleanupVerificationTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/RegisterFilesForCleanupVerificationTask.cs.meta new file mode 100644 index 0000000..a2ef8c8 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/RegisterFilesForCleanupVerificationTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: a398fde47a0349a40a9bdf8988c392c9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveModiedSceneTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveModiedSceneTask.cs new file mode 100644 index 0000000..a2ec975 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveModiedSceneTask.cs @@ -0,0 +1,22 @@ +using System;
+using System.Collections;
+using UnityEditor.SceneManagement;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal class SaveModiedSceneTask : TestTaskBase
+ {
+ internal Func<bool> SaveCurrentModifiedScenesIfUserWantsTo =
+ EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo;
+ public override IEnumerator Execute(TestJobData testJobData)
+ {
+ var cancelled = !SaveCurrentModifiedScenesIfUserWantsTo();
+ if (cancelled)
+ {
+ throw new TestRunCanceledException();
+ }
+
+ yield break;
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveModiedSceneTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveModiedSceneTask.cs.meta new file mode 100644 index 0000000..b710751 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveModiedSceneTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: c321246872d389b469bd0cb86d3701ed
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveUndoIndexTask.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveUndoIndexTask.cs new file mode 100644 index 0000000..45b1227 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveUndoIndexTask.cs @@ -0,0 +1,15 @@ +using System;
+using System.Collections;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal class SaveUndoIndexTask : TestTaskBase
+ {
+ internal Func<int> GetUndoGroup = Undo.GetCurrentGroup;
+ public override IEnumerator Execute(TestJobData testJobData)
+ {
+ testJobData.undoGroup = GetUndoGroup();
+ yield break;
+ }
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveUndoIndexTask.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveUndoIndexTask.cs.meta new file mode 100644 index 0000000..d79dc22 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/SaveUndoIndexTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: cc0ce06a7515c044bb8db4c75db84114
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/TestTaskBase.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/TestTaskBase.cs new file mode 100644 index 0000000..d83490b --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/TestTaskBase.cs @@ -0,0 +1,16 @@ +using System.Collections;
+
+namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
+{
+ internal abstract class TestTaskBase
+ {
+ public bool SupportsResumingEnumerator;
+
+ protected TestTaskBase(bool supportsResumingEnumerator = false)
+ {
+ SupportsResumingEnumerator = supportsResumingEnumerator;
+ }
+
+ public abstract IEnumerator Execute(TestJobData testJobData);
+ }
+}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/TestTaskBase.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/TestTaskBase.cs.meta new file mode 100644 index 0000000..89edb19 --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRun/Tasks/TestTaskBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2
+guid: 342d9ef4da0a19b49877f576c2deec14
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
|
