diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-20 19:09:33 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-20 19:09:33 -0400 |
| commit | 7c1e566113d59699af1624186c64eca67f063fc6 (patch) | |
| tree | 5a6850a695986872d5d0b09d7dab8421628fe33e /Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner | |
| parent | dd117b77aae1d8be7563b360d05b842a73b7dab2 (diff) | |
| download | Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.tar.gz Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.tar.bz2 Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.zip | |
Upgraded Unity
Diffstat (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner')
63 files changed, 0 insertions, 2017 deletions
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks.meta deleted file mode 100644 index d7be998..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2
-guid: 5d7f0d6acfced954682a89e7002c04d9
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/EditModeRunnerCallback.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/EditModeRunnerCallback.cs deleted file mode 100644 index 7d026fa..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/EditModeRunnerCallback.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System;
-using System.Collections.Generic;
-using System.Linq;
-using NUnit.Framework;
-using NUnit.Framework.Interfaces;
-using NUnit.Framework.Internal;
-using UnityEditor.SceneManagement;
-using UnityEngine;
-using UnityEngine.TestTools.TestRunner;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class EditModeRunnerCallback : ScriptableObject, ITestRunnerListener
- {
- private EditModeLauncherContextSettings m_Settings;
- public SceneSetup[] previousSceneSetup;
- public EditModeRunner runner;
-
- private bool m_Canceled;
- private ITest m_CurrentTest;
- private int m_TotalTests;
-
- [SerializeField]
- private List<string> m_PendingTests;
- [SerializeField]
- private string m_LastCountedTestName;
- [SerializeField]
- private bool m_RunRestarted;
-
- public void OnDestroy()
- {
- CleanUp();
- }
-
- public void RunStarted(ITest testsToRun)
- {
- Setup();
- if (m_PendingTests == null)
- {
- m_PendingTests = GetTestsExpectedToRun(testsToRun, runner.GetFilter());
- m_TotalTests = m_PendingTests.Count;
- }
- }
-
- public void OnEnable()
- {
- if (m_RunRestarted)
- {
- Setup();
- }
- }
-
- private void Setup()
- {
- m_Settings = new EditModeLauncherContextSettings();
- Application.logMessageReceivedThreaded += LogReceived;
- EditorApplication.playModeStateChanged += WaitForExitPlaymode;
- EditorApplication.update += DisplayProgressBar;
- AssemblyReloadEvents.beforeAssemblyReload += BeforeAssemblyReload;
- }
-
- private void BeforeAssemblyReload()
- {
- if (m_CurrentTest != null)
- {
- m_LastCountedTestName = m_CurrentTest.FullName;
- m_RunRestarted = true;
- }
- }
-
- private void DisplayProgressBar()
- {
- if (m_CurrentTest == null)
- return;
- if (!m_Canceled && EditorUtility.DisplayCancelableProgressBar("Test Runner", "Running test " + m_CurrentTest.Name, Math.Min(1.0f, (float)(m_TotalTests - m_PendingTests.Count) / m_TotalTests)))
- {
- EditorApplication.update -= DisplayProgressBar;
- m_Canceled = true;
- EditorUtility.ClearProgressBar();
- runner.OnRunCancel();
- }
- }
-
- private static void LogReceived(string message, string stacktrace, LogType type)
- {
- if (TestContext.Out != null)
- TestContext.Out.WriteLine(message);
- }
-
- private static void WaitForExitPlaymode(PlayModeStateChange state)
- {
- if (state == PlayModeStateChange.EnteredEditMode)
- {
- EditorApplication.playModeStateChanged -= WaitForExitPlaymode;
- //because logMessage is reset on Enter EditMode
- //we remove and add the callback
- //because Unity
- Application.logMessageReceivedThreaded -= LogReceived;
- Application.logMessageReceivedThreaded += LogReceived;
- }
- }
-
- public void RunFinished(ITestResult result)
- {
- if (previousSceneSetup != null && previousSceneSetup.Length > 0)
- {
- try
- {
- EditorSceneManager.RestoreSceneManagerSetup(previousSceneSetup);
- }
- catch (ArgumentException e)
- {
- Debug.LogWarning(e.Message);
- }
- }
- else
- {
- EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single);
- }
- CleanUp();
- }
-
- private void CleanUp()
- {
- m_CurrentTest = null;
- EditorUtility.ClearProgressBar();
- if (m_Settings != null)
- {
- m_Settings.Dispose();
- }
- Application.logMessageReceivedThreaded -= LogReceived;
- EditorApplication.update -= DisplayProgressBar;
- }
-
- public void TestStarted(ITest test)
- {
- if (test.IsSuite || !(test is TestMethod))
- {
- return;
- }
-
- m_CurrentTest = test;
-
- if (m_RunRestarted)
- {
- if (test.FullName == m_LastCountedTestName)
- m_RunRestarted = false;
- }
- }
-
- public void TestFinished(ITestResult result)
- {
- if (result.Test is TestMethod)
- {
- m_PendingTests.Remove(result.Test.FullName);
- }
- }
-
- private static List<string> GetTestsExpectedToRun(ITest test, ITestFilter filter)
- {
- var expectedTests = new List<string>();
-
- if (filter.Pass(test))
- {
- if (test.IsSuite)
- {
- expectedTests.AddRange(test.Tests.SelectMany(subTest => GetTestsExpectedToRun(subTest, filter)));
- }
- else
- {
- expectedTests.Add(test.FullName);
- }
- }
-
- return expectedTests;
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/EditModeRunnerCallback.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/EditModeRunnerCallback.cs.meta deleted file mode 100644 index 5c5501b..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/EditModeRunnerCallback.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: cc456ba93311a3a43ad896449fee9868
-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/TestRunner/Callbacks/RerunCallback.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallback.cs deleted file mode 100644 index 2515ea7..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallback.cs +++ /dev/null @@ -1,86 +0,0 @@ -using UnityEditor.TestTools.TestRunner.Api;
-using UnityEditor.TestTools.TestRunner.CommandLineTest;
-using UnityEngine.TestTools.TestRunner.GUI;
-using UnityEngine;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class RerunCallback : ScriptableObject, ICallbacks
- {
- public static bool useMockRunFilter = false;
- public static TestRunnerFilter mockRunFilter = null;
-
- public void RunFinished(ITestResultAdaptor result)
- {
- if (RerunCallbackData.instance.runFilters == null || RerunCallbackData.instance.runFilters.Length == 0)
- RerunCallbackData.instance.runFilters = new[] {new TestRunnerFilter()};
-
- var runFilter = RerunCallbackData.instance.runFilters[0];
-
- if (useMockRunFilter)
- {
- runFilter = mockRunFilter;
- }
-
- runFilter.testRepetitions--;
- if (runFilter.testRepetitions <= 0 || result.TestStatus != TestStatus.Passed)
- {
- ExitCallbacks.preventExit = false;
- return;
- }
-
- ExitCallbacks.preventExit = true;
- if (EditorApplication.isPlaying)
- {
- EditorApplication.playModeStateChanged += WaitForExitPlaymode;
- return;
- }
-
- if (!useMockRunFilter)
- {
- ExecuteTestRunnerAPI();
- }
- }
-
- private static void WaitForExitPlaymode(PlayModeStateChange state)
- {
- if (state == PlayModeStateChange.EnteredEditMode)
- {
- ExecuteTestRunnerAPI();
- }
- }
-
- private static void ExecuteTestRunnerAPI()
- {
- var runFilter = RerunCallbackData.instance.runFilters[0];
- var testMode = RerunCallbackData.instance.testMode;
-
- var testRunnerApi = ScriptableObject.CreateInstance<TestRunnerApi>();
- testRunnerApi.Execute(new Api.ExecutionSettings()
- {
- filters = new[]
- {
- new Filter()
- {
- categoryNames = runFilter.categoryNames,
- groupNames = runFilter.groupNames,
- testMode = testMode,
- testNames = runFilter.testNames
- }
- }
- });
- }
-
- public void TestStarted(ITestAdaptor test)
- {
- }
-
- public void TestFinished(ITestResultAdaptor result)
- {
- }
-
- public void RunStarted(ITestAdaptor testsToRun)
- {
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallback.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallback.cs.meta deleted file mode 100644 index b4fc0e2..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallback.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: b7ff2b2e91321ff4381d4ab45870a32e
-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/TestRunner/Callbacks/RerunCallbackData.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackData.cs deleted file mode 100644 index 8aeeeec..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackData.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UnityEditor.TestTools.TestRunner.Api;
-using UnityEngine;
-using UnityEngine.TestTools.TestRunner.GUI;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class RerunCallbackData : ScriptableSingleton<RerunCallbackData>
- {
- [SerializeField]
- internal TestRunnerFilter[] runFilters;
-
- [SerializeField]
- internal TestMode testMode;
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackData.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackData.cs.meta deleted file mode 100644 index bc911fe..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackData.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 087cba9fa6ac867479a0b0fdc0a5864b
-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/TestRunner/Callbacks/RerunCallbackInitializer.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackInitializer.cs deleted file mode 100644 index 86be497..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackInitializer.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEngine;
-using UnityEditor.TestTools.TestRunner.Api;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- [InitializeOnLoad]
- static class RerunCallbackInitializer
- {
- static RerunCallbackInitializer()
- {
- var testRunnerApi = ScriptableObject.CreateInstance<TestRunnerApi>();
-
- var rerunCallback = ScriptableObject.CreateInstance<RerunCallback>();
- testRunnerApi.RegisterCallbacks<RerunCallback>(rerunCallback);
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackInitializer.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackInitializer.cs.meta deleted file mode 100644 index 1f50bcc..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/RerunCallbackInitializer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: f73fc901e4b0f2d4daf11f46506054ba
-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/TestRunner/Callbacks/TestRunnerCallback.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/TestRunnerCallback.cs deleted file mode 100644 index 6e89c21..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/TestRunnerCallback.cs +++ /dev/null @@ -1,37 +0,0 @@ -using NUnit.Framework.Interfaces;
-using UnityEngine;
-using UnityEngine.TestTools.TestRunner;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class TestRunnerCallback : ScriptableObject, ITestRunnerListener
- {
- public void RunStarted(ITest testsToRun)
- {
- EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
- }
-
- private void OnPlayModeStateChanged(PlayModeStateChange state)
- {
- if (state == PlayModeStateChange.ExitingPlayMode)
- {
- EditorApplication.playModeStateChanged -= OnPlayModeStateChanged;
- //We need to make sure we don't block NUnit thread in case we exit PlayMode earlier
- PlaymodeTestsController.TryCleanup();
- }
- }
-
- public void RunFinished(ITestResult testResults)
- {
- EditorApplication.isPlaying = false;
- }
-
- public void TestStarted(ITest testName)
- {
- }
-
- public void TestFinished(ITestResult test)
- {
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/TestRunnerCallback.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/TestRunnerCallback.cs.meta deleted file mode 100644 index a592975..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/TestRunnerCallback.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: d44e6804bc58be84ea71a619b468f150
-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/TestRunner/Callbacks/WindowResultUpdater.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/WindowResultUpdater.cs deleted file mode 100644 index 831d769..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/WindowResultUpdater.cs +++ /dev/null @@ -1,44 +0,0 @@ -using UnityEditor.TestTools.TestRunner.Api;
-
-namespace UnityEditor.TestTools.TestRunner.GUI
-{
- internal class WindowResultUpdater : ICallbacks, ITestTreeRebuildCallbacks
- {
- public void RunStarted(ITestAdaptor testsToRun)
- {
- }
-
- public void RunFinished(ITestResultAdaptor testResults)
- {
- if (TestRunnerWindow.s_Instance != null)
- {
- TestRunnerWindow.s_Instance.RebuildUIFilter();
- }
- }
-
- public void TestStarted(ITestAdaptor testName)
- {
- }
-
- public void TestFinished(ITestResultAdaptor test)
- {
- if (TestRunnerWindow.s_Instance == null)
- {
- return;
- }
-
- var result = new TestRunnerResult(test);
- TestRunnerWindow.s_Instance.m_SelectedTestTypes.UpdateResult(result);
- }
-
- public void TestTreeRebuild(ITestAdaptor test)
- {
- if (TestRunnerWindow.s_Instance == null)
- {
- return;
- }
-
- TestRunnerWindow.s_Instance.m_SelectedTestTypes.UpdateTestTree(test);
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/WindowResultUpdater.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/WindowResultUpdater.cs.meta deleted file mode 100644 index 5273cf4..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Callbacks/WindowResultUpdater.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 6d468ee3657be7a43a2ef2178ec14239
-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/TestRunner/EditModePCHelper.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModePCHelper.cs deleted file mode 100644 index 7968041..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModePCHelper.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections;
-using System.Reflection;
-using UnityEngine.TestTools;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class EditModePcHelper : TestCommandPcHelper
- {
- public override void SetEnumeratorPC(IEnumerator enumerator, int pc)
- {
- GetPCFieldInfo(enumerator).SetValue(enumerator, pc);
- }
-
- public override int GetEnumeratorPC(IEnumerator enumerator)
- {
- if (enumerator == null)
- {
- return 0;
- }
- return (int)GetPCFieldInfo(enumerator).GetValue(enumerator);
- }
-
- private FieldInfo GetPCFieldInfo(IEnumerator enumerator)
- {
- var field = enumerator.GetType().GetField("$PC", BindingFlags.NonPublic | BindingFlags.Instance);
- if (field == null) // Roslyn
- field = enumerator.GetType().GetField("<>1__state", BindingFlags.NonPublic | BindingFlags.Instance);
-
- return field;
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModePCHelper.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModePCHelper.cs.meta deleted file mode 100644 index 2bb2d0b..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModePCHelper.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 6d16f2e78a356d34c9a32108929de932
-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/TestRunner/EditModeRunner.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModeRunner.cs deleted file mode 100644 index c0d72b4..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModeRunner.cs +++ /dev/null @@ -1,438 +0,0 @@ -using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using NUnit.Framework.Interfaces;
-using NUnit.Framework.Internal;
-using NUnit.Framework.Internal.Filters;
-using UnityEngine;
-using UnityEngine.TestTools.NUnitExtensions;
-using UnityEngine.TestTools.TestRunner;
-using UnityEngine.TestTools;
-using UnityEngine.TestTools.TestRunner.GUI;
-using UnityEditor.Callbacks;
-using UnityEditor.TestTools.TestRunner.Api;
-using UnityEngine.TestRunner.NUnitExtensions;
-using UnityEngine.TestRunner.NUnitExtensions.Runner;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal interface IUnityTestAssemblyRunnerFactory
- {
- IUnityTestAssemblyRunner Create(TestPlatform testPlatform, WorkItemFactory factory);
- }
-
- internal class UnityTestAssemblyRunnerFactory : IUnityTestAssemblyRunnerFactory
- {
- public IUnityTestAssemblyRunner Create(TestPlatform testPlatform, WorkItemFactory factory)
- {
- return new UnityTestAssemblyRunner(new UnityTestAssemblyBuilder(), factory);
- }
- }
-
- [Serializable]
- internal class EditModeRunner : ScriptableObject, IDisposable
- {
- [SerializeField]
- private Filter[] m_Filters;
-
- //The counter from the IEnumerator object
- [SerializeField]
- private int m_CurrentPC;
-
- [SerializeField]
- private bool m_ExecuteOnEnable;
-
- [SerializeField]
- private List<string> m_AlreadyStartedTests;
-
- [SerializeField]
- private List<TestResultSerializer> m_ExecutedTests;
-
- [SerializeField]
- private List<ScriptableObject> m_CallbackObjects = new List<ScriptableObject>();
-
- [SerializeField]
- private TestStartedEvent m_TestStartedEvent = new TestStartedEvent();
-
- [SerializeField]
- private TestFinishedEvent m_TestFinishedEvent = new TestFinishedEvent();
-
- [SerializeField]
- private RunStartedEvent m_RunStartedEvent = new RunStartedEvent();
-
- [SerializeField]
- private RunFinishedEvent m_RunFinishedEvent = new RunFinishedEvent();
-
- [SerializeField]
- private TestRunnerStateSerializer m_TestRunnerStateSerializer = new TestRunnerStateSerializer();
-
- [SerializeField]
- private bool m_RunningTests;
-
- [SerializeField]
- private TestPlatform m_TestPlatform;
-
- [SerializeField]
- private object m_CurrentYieldObject;
-
- [SerializeField]
- private BeforeAfterTestCommandState m_SetUpTearDownState;
- [SerializeField]
- private BeforeAfterTestCommandState m_OuterUnityTestActionState;
-
- [SerializeField]
- public bool RunFinished = false;
-
- public bool RunningSynchronously { get; private set; }
-
- internal IUnityTestAssemblyRunner m_Runner;
-
- private ConstructDelegator m_ConstructDelegator;
-
- private IEnumerator m_RunStep;
-
- public IUnityTestAssemblyRunnerFactory UnityTestAssemblyRunnerFactory { get; set; }
-
- public void Init(Filter[] filters, TestPlatform platform, bool runningSynchronously)
- {
- m_Filters = filters;
- m_TestPlatform = platform;
- m_AlreadyStartedTests = new List<string>();
- m_ExecutedTests = new List<TestResultSerializer>();
- RunningSynchronously = runningSynchronously;
- InitRunner();
- }
-
- private void InitRunner()
- {
- //We give the EditMode platform here so we dont suddenly create Playmode work items in the test Runner.
- m_Runner = (UnityTestAssemblyRunnerFactory ?? new UnityTestAssemblyRunnerFactory()).Create(TestPlatform.EditMode, new EditmodeWorkItemFactory());
- var testAssemblyProvider = new EditorLoadedTestAssemblyProvider(new EditorCompilationInterfaceProxy(), new EditorAssembliesProxy());
- var assemblies = testAssemblyProvider.GetAssembliesGroupedByType(m_TestPlatform).Select(x => x.Assembly).ToArray();
- var loadedTests = m_Runner.Load(assemblies, TestPlatform.EditMode,
- UnityTestAssemblyBuilder.GetNUnitTestBuilderSettings(m_TestPlatform));
- loadedTests.ParseForNameDuplicates();
- CallbacksDelegator.instance.TestTreeRebuild(loadedTests);
- hideFlags |= HideFlags.DontSave;
- EnumerableSetUpTearDownCommand.ActivePcHelper = new EditModePcHelper();
- OuterUnityTestActionCommand.ActivePcHelper = new EditModePcHelper();
- }
-
- public void OnEnable()
- {
- if (m_ExecuteOnEnable)
- {
- InitRunner();
- m_ExecuteOnEnable = false;
- foreach (var callback in m_CallbackObjects)
- {
- AddListeners(callback as ITestRunnerListener);
- }
- m_ConstructDelegator = new ConstructDelegator(m_TestRunnerStateSerializer);
-
- EnumeratorStepHelper.SetEnumeratorPC(m_CurrentPC);
-
- UnityWorkItemDataHolder.alreadyExecutedTests = m_ExecutedTests.Select(x => x.fullName).ToList();
- UnityWorkItemDataHolder.alreadyStartedTests = m_AlreadyStartedTests;
- Run();
- }
- }
-
- public void TestStartedEvent(ITest test)
- {
- m_AlreadyStartedTests.Add(test.FullName);
- }
-
- public void TestFinishedEvent(ITestResult testResult)
- {
- m_AlreadyStartedTests.Remove(testResult.FullName);
- m_ExecutedTests.Add(TestResultSerializer.MakeFromTestResult(testResult));
- }
-
- public void Run()
- {
- EditModeTestCallbacks.RestoringTestContext += OnRestoringTest;
- var context = m_Runner.GetCurrentContext();
- if (m_SetUpTearDownState == null)
- {
- m_SetUpTearDownState = CreateInstance<BeforeAfterTestCommandState>();
- }
- context.SetUpTearDownState = m_SetUpTearDownState;
-
- if (m_OuterUnityTestActionState == null)
- {
- m_OuterUnityTestActionState = CreateInstance<BeforeAfterTestCommandState>();
- }
- context.OuterUnityTestActionState = m_OuterUnityTestActionState;
-
- if (!m_RunningTests)
- {
- m_RunStartedEvent.Invoke(m_Runner.LoadedTest);
- }
-
- if (m_ConstructDelegator == null)
- m_ConstructDelegator = new ConstructDelegator(m_TestRunnerStateSerializer);
-
- Reflect.ConstructorCallWrapper = m_ConstructDelegator.Delegate;
- m_TestStartedEvent.AddListener(TestStartedEvent);
- m_TestFinishedEvent.AddListener(TestFinishedEvent);
-
- AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload;
-
- RunningTests = true;
-
- EditorApplication.LockReloadAssemblies();
-
- var testListenerWrapper = new TestListenerWrapper(m_TestStartedEvent, m_TestFinishedEvent);
- m_RunStep = m_Runner.Run(testListenerWrapper, GetFilter()).GetEnumerator();
- m_RunningTests = true;
-
- if (!RunningSynchronously)
- EditorApplication.update += TestConsumer;
- }
-
- public void CompleteSynchronously()
- {
- while (!m_Runner.IsTestComplete)
- TestConsumer();
- }
-
- private void OnBeforeAssemblyReload()
- {
- EditorApplication.update -= TestConsumer;
-
- if (m_ExecuteOnEnable)
- {
- AssemblyReloadEvents.beforeAssemblyReload -= OnBeforeAssemblyReload;
- return;
- }
-
- if (m_Runner != null && m_Runner.TopLevelWorkItem != null)
- m_Runner.TopLevelWorkItem.ResultedInDomainReload = true;
-
- if (RunningTests)
- {
- Debug.LogError("TestRunner: Unexpected assembly reload happened while running tests");
-
- EditorUtility.ClearProgressBar();
-
- if (m_Runner.GetCurrentContext() != null && m_Runner.GetCurrentContext().CurrentResult != null)
- {
- m_Runner.GetCurrentContext().CurrentResult.SetResult(ResultState.Cancelled, "Unexpected assembly reload happened");
- }
- OnRunCancel();
- }
- }
-
- private bool RunningTests;
-
- private Stack<IEnumerator> StepStack = new Stack<IEnumerator>();
-
- private bool MoveNextAndUpdateYieldObject()
- {
- var result = m_RunStep.MoveNext();
-
- if (result)
- {
- m_CurrentYieldObject = m_RunStep.Current;
- while (m_CurrentYieldObject is IEnumerator) // going deeper
- {
- var currentEnumerator = (IEnumerator)m_CurrentYieldObject;
-
- // go deeper and add parent to stack
- StepStack.Push(m_RunStep);
-
- m_RunStep = currentEnumerator;
- m_CurrentYieldObject = m_RunStep.Current;
- }
-
- if (StepStack.Count > 0 && m_CurrentYieldObject != null) // not null and not IEnumerator, nested
- {
- Debug.LogError("EditMode test can only yield null, but not <" + m_CurrentYieldObject.GetType().Name + ">");
- }
-
- return true;
- }
-
- if (StepStack.Count == 0) // done
- return false;
-
- m_RunStep = StepStack.Pop(); // going up
- return MoveNextAndUpdateYieldObject();
- }
-
- private void TestConsumer()
- {
- var moveNext = MoveNextAndUpdateYieldObject();
-
- if (m_CurrentYieldObject != null)
- {
- InvokeDelegator();
- }
-
- if (!moveNext && !m_Runner.IsTestComplete)
- {
- CompleteTestRun();
- throw new IndexOutOfRangeException("There are no more elements to process and IsTestComplete is false");
- }
-
- if (m_Runner.IsTestComplete)
- {
- CompleteTestRun();
- }
- }
-
- private void CompleteTestRun()
- {
- if (!RunningSynchronously)
- EditorApplication.update -= TestConsumer;
-
- TestLauncherBase.ExecutePostBuildCleanupMethods(this.GetLoadedTests(), this.GetFilter(), Application.platform);
-
- m_RunFinishedEvent.Invoke(m_Runner.Result);
- RunFinished = true;
-
- if (m_ConstructDelegator != null)
- m_ConstructDelegator.DestroyCurrentTestObjectIfExists();
- Dispose();
- UnityWorkItemDataHolder.alreadyExecutedTests = null;
- }
-
- private void OnRestoringTest()
- {
- var item = m_ExecutedTests.Find(t => t.fullName == UnityTestExecutionContext.CurrentContext.CurrentTest.FullName);
- if (item != null)
- {
- item.RestoreTestResult(UnityTestExecutionContext.CurrentContext.CurrentResult);
- }
- }
-
- private static bool IsCancelled()
- {
- return UnityTestExecutionContext.CurrentContext.ExecutionStatus == TestExecutionStatus.AbortRequested || UnityTestExecutionContext.CurrentContext.ExecutionStatus == TestExecutionStatus.StopRequested;
- }
-
- private void InvokeDelegator()
- {
- if (m_CurrentYieldObject == null)
- {
- return;
- }
-
- if (IsCancelled())
- {
- return;
- }
-
- if (m_CurrentYieldObject is RestoreTestContextAfterDomainReload)
- {
- if (m_TestRunnerStateSerializer.ShouldRestore())
- {
- m_TestRunnerStateSerializer.RestoreContext();
- }
-
- return;
- }
-
- try
- {
- if (m_CurrentYieldObject is IEditModeTestYieldInstruction)
- {
- var editModeTestYieldInstruction = (IEditModeTestYieldInstruction)m_CurrentYieldObject;
- if (editModeTestYieldInstruction.ExpectDomainReload)
- {
- PrepareForDomainReload();
- }
- return;
- }
- }
- catch (Exception e)
- {
- UnityTestExecutionContext.CurrentContext.CurrentResult.RecordException(e);
- return;
- }
-
- Debug.LogError("EditMode test can only yield null");
- }
-
- private void CompilationFailureWatch()
- {
- if (EditorApplication.isCompiling)
- return;
-
- EditorApplication.update -= CompilationFailureWatch;
-
- if (EditorUtility.scriptCompilationFailed)
- {
- EditorUtility.ClearProgressBar();
- OnRunCancel();
- }
- }
-
- private void PrepareForDomainReload()
- {
- m_TestRunnerStateSerializer.SaveContext();
- m_CurrentPC = EnumeratorStepHelper.GetEnumeratorPC(TestEnumerator.Enumerator);
- m_ExecuteOnEnable = true;
-
- RunningTests = false;
- }
-
- public T AddEventHandler<T>() where T : ScriptableObject, ITestRunnerListener
- {
- var eventHandler = CreateInstance<T>();
- eventHandler.hideFlags |= HideFlags.DontSave;
- m_CallbackObjects.Add(eventHandler);
-
- AddListeners(eventHandler);
-
- return eventHandler;
- }
-
- private void AddListeners(ITestRunnerListener eventHandler)
- {
- m_TestStartedEvent.AddListener(eventHandler.TestStarted);
- m_TestFinishedEvent.AddListener(eventHandler.TestFinished);
- m_RunStartedEvent.AddListener(eventHandler.RunStarted);
- m_RunFinishedEvent.AddListener(eventHandler.RunFinished);
- }
-
- public void Dispose()
- {
- Reflect.MethodCallWrapper = null;
- EditorApplication.update -= TestConsumer;
-
- DestroyImmediate(this);
-
- if (m_CallbackObjects != null)
- {
- foreach (var obj in m_CallbackObjects)
- {
- DestroyImmediate(obj);
- }
- m_CallbackObjects.Clear();
- }
- RunningTests = false;
- EditorApplication.UnlockReloadAssemblies();
- }
-
- public void OnRunCancel()
- {
- UnityWorkItemDataHolder.alreadyExecutedTests = null;
- m_ExecuteOnEnable = false;
- m_Runner.StopRun();
- RunFinished = true;
- }
-
- public ITest GetLoadedTests()
- {
- return m_Runner.LoadedTest;
- }
-
- public ITestFilter GetFilter()
- {
- return new OrFilter(m_Filters.Select(filter => filter.BuildNUnitFilter(RunningSynchronously)).ToArray());
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModeRunner.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModeRunner.cs.meta deleted file mode 100644 index faf2358..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditModeRunner.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: c9219e99d466b7741a057132d1994f35
-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/TestRunner/EditmodeWorkItemFactory.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditmodeWorkItemFactory.cs deleted file mode 100644 index a81fcdc..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditmodeWorkItemFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -using NUnit.Framework.Interfaces;
-using NUnit.Framework.Internal;
-using UnityEngine.TestRunner.NUnitExtensions.Runner;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class EditmodeWorkItemFactory : WorkItemFactory
- {
- protected override UnityWorkItem Create(TestMethod method, ITestFilter filter, ITest loadedTest)
- {
- return new EditorEnumeratorTestWorkItem(method, filter);
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditmodeWorkItemFactory.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditmodeWorkItemFactory.cs.meta deleted file mode 100644 index d775d1f..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditmodeWorkItemFactory.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 3dde15f260b0dd1469e60d16eaa795dc
-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/TestRunner/EditorEnumeratorTestWorkItem.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditorEnumeratorTestWorkItem.cs deleted file mode 100644 index 14d12c2..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditorEnumeratorTestWorkItem.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System;
-using System.Collections;
-using NUnit.Framework.Interfaces;
-using NUnit.Framework.Internal;
-using NUnit.Framework.Internal.Commands;
-using NUnit.Framework.Internal.Execution;
-using UnityEngine;
-using UnityEngine.TestRunner.NUnitExtensions.Runner;
-using UnityEngine.TestTools;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class EditorEnumeratorTestWorkItem : UnityWorkItem
- {
- private TestCommand m_Command;
-
- public EditorEnumeratorTestWorkItem(TestMethod test, ITestFilter filter)
- : base(test, null)
- {
- m_Command = TestCommandBuilder.BuildTestCommand(test, filter);
- }
-
- private static IEnumerableTestMethodCommand FindFirstIEnumerableTestMethodCommand(TestCommand command)
- {
- if (command == null)
- {
- return null;
- }
-
- if (command is IEnumerableTestMethodCommand)
- {
- return (IEnumerableTestMethodCommand)command;
- }
-
- if (command is DelegatingTestCommand)
- {
- var delegatingTestCommand = (DelegatingTestCommand)command;
- return FindFirstIEnumerableTestMethodCommand(delegatingTestCommand.GetInnerCommand());
- }
- return null;
- }
-
- protected override IEnumerable PerformWork()
- {
- if (IsCancelledRun())
- {
- yield break;
- }
-
- if (m_DontRunRestoringResult)
- {
- if (EditModeTestCallbacks.RestoringTestContext == null)
- {
- throw new NullReferenceException("RestoringTestContext is not set");
- }
- EditModeTestCallbacks.RestoringTestContext();
- Result = Context.CurrentResult;
- yield break;
- }
-
- try
- {
- if (IsCancelledRun())
- {
- yield break;
- }
-
- if (m_Command is SkipCommand)
- {
- m_Command.Execute(Context);
- Result = Context.CurrentResult;
- yield break;
- }
-
- //Check if we can execute this test
- var firstEnumerableCommand = FindFirstIEnumerableTestMethodCommand(m_Command);
- if (firstEnumerableCommand == null)
- {
- Context.CurrentResult.SetResult(ResultState.Error, "Returning IEnumerator but not using test attribute supporting this");
- yield break;
- }
-
- if (m_Command.Test.Method.ReturnType.IsType(typeof(IEnumerator)))
- {
- if (m_Command is ApplyChangesToContextCommand)
- {
- var applyChangesToContextCommand = ((ApplyChangesToContextCommand)m_Command);
- applyChangesToContextCommand.ApplyChanges(Context);
- m_Command = applyChangesToContextCommand.GetInnerCommand();
- }
-
- var innerCommand = m_Command as IEnumerableTestMethodCommand;
- if (innerCommand == null)
- {
- Debug.Log("failed getting innerCommand");
- throw new Exception("Tests returning IEnumerator can only use test attributes handling those");
- }
-
- foreach (var workItemStep in innerCommand.ExecuteEnumerable(Context))
- {
- if (IsCancelledRun())
- {
- yield break;
- }
-
- if (workItemStep is TestEnumerator)
- {
- if (EnumeratorStepHelper.UpdateEnumeratorPcIfNeeded(TestEnumerator.Enumerator))
- {
- yield return new RestoreTestContextAfterDomainReload();
- }
- continue;
- }
-
- if (workItemStep is AsyncOperation)
- {
- var asyncOperation = (AsyncOperation)workItemStep;
- while (!asyncOperation.isDone)
- {
- if (IsCancelledRun())
- {
- yield break;
- }
-
- yield return null;
- }
- continue;
- }
-
- ResultedInDomainReload = false;
-
- if (workItemStep is IEditModeTestYieldInstruction)
- {
- var editModeTestYieldInstruction = (IEditModeTestYieldInstruction)workItemStep;
- yield return editModeTestYieldInstruction;
- var enumerator = editModeTestYieldInstruction.Perform();
- while (true)
- {
- bool moveNext;
- try
- {
- moveNext = enumerator.MoveNext();
- }
- catch (Exception e)
- {
- Context.CurrentResult.RecordException(e);
- break;
- }
-
- if (!moveNext)
- {
- break;
- }
- yield return null;
- }
- }
- else
- {
- yield return workItemStep;
- }
- }
-
- Result = Context.CurrentResult;
- EditorApplication.isPlaying = false;
- yield return null;
- }
- }
- finally
- {
- WorkItemComplete();
- }
- }
-
- private bool IsCancelledRun()
- {
- return Context.ExecutionStatus == TestExecutionStatus.AbortRequested || Context.ExecutionStatus == TestExecutionStatus.StopRequested;
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditorEnumeratorTestWorkItem.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditorEnumeratorTestWorkItem.cs.meta deleted file mode 100644 index 9007130..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EditorEnumeratorTestWorkItem.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 1ebc1994f9a3d5649a1201d3a84b38df
-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/TestRunner/EnumeratorStepHelper.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EnumeratorStepHelper.cs deleted file mode 100644 index 0809a6f..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EnumeratorStepHelper.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections;
-using System.Reflection;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class EnumeratorStepHelper
- {
- private static int m_PC;
-
- public static void SetEnumeratorPC(int pc)
- {
- m_PC = pc;
- }
-
- /// <summary>
- /// Gets the current enumerator PC
- /// </summary>
- /// <returns>
- /// The PC
- /// 0 if no current Enumeration
- /// </returns>
- public static int GetEnumeratorPC(IEnumerator enumerator)
- {
- if (enumerator == null)
- {
- return 0;
- }
- return (int)GetPCFieldInfo(enumerator).GetValue(enumerator);
- }
-
- public static bool UpdateEnumeratorPcIfNeeded(IEnumerator enumerator)
- {
- if (m_PC > 0)
- {
- GetPCFieldInfo(enumerator).SetValue(enumerator, m_PC);
- m_PC = 0;
- return true;
- }
- return false;
- }
-
- private static FieldInfo GetPCFieldInfo(IEnumerator enumerator)
- {
- var field = enumerator.GetType().GetField("$PC", BindingFlags.NonPublic | BindingFlags.Instance);
- if (field == null) // Roslyn
- field = enumerator.GetType().GetField("<>1__state", BindingFlags.NonPublic | BindingFlags.Instance);
-
- return field;
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EnumeratorStepHelper.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EnumeratorStepHelper.cs.meta deleted file mode 100644 index 92e993b..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/EnumeratorStepHelper.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 901b761c5c1e22d4e8a3ba7d95bc1f5d
-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/TestRunner/Messages.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages.meta deleted file mode 100644 index 64ff2d2..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2
-guid: d9682e749d3efc642af54d789d9090a6
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/EnterPlayMode.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/EnterPlayMode.cs deleted file mode 100644 index e1ad8c7..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/EnterPlayMode.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System;
-using System.Collections;
-using UnityEditor;
-
-namespace UnityEngine.TestTools
-{
- public class EnterPlayMode : IEditModeTestYieldInstruction
- {
- public bool ExpectDomainReload { get; }
- public bool ExpectedPlaymodeState { get; private set; }
-
- public EnterPlayMode(bool expectDomainReload = true)
- {
- ExpectDomainReload = expectDomainReload;
- }
-
- public IEnumerator Perform()
- {
- if (EditorApplication.isPlaying)
- {
- throw new Exception("Editor is already in PlayMode");
- }
- if (EditorUtility.scriptCompilationFailed)
- {
- throw new Exception("Script compilation failed");
- }
- yield return null;
- ExpectedPlaymodeState = true;
-
- EditorApplication.UnlockReloadAssemblies();
- EditorApplication.isPlaying = true;
-
- while (!EditorApplication.isPlaying)
- {
- yield return null;
- }
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/EnterPlayMode.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/EnterPlayMode.cs.meta deleted file mode 100644 index f1775e7..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/EnterPlayMode.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 9bd5a110ed89025499ddee8c7e73778e
-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/TestRunner/Messages/ExitPlayMode.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/ExitPlayMode.cs deleted file mode 100644 index 85ef889..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/ExitPlayMode.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System;
-using System.Collections;
-using UnityEditor;
-
-namespace UnityEngine.TestTools
-{
- public class ExitPlayMode : IEditModeTestYieldInstruction
- {
- public bool ExpectDomainReload { get; }
- public bool ExpectedPlaymodeState { get; private set; }
-
- public ExitPlayMode()
- {
- ExpectDomainReload = false;
- ExpectedPlaymodeState = false;
- }
-
- public IEnumerator Perform()
- {
- if (!EditorApplication.isPlayingOrWillChangePlaymode)
- {
- throw new Exception("Editor is already in EditMode");
- }
-
- EditorApplication.isPlaying = false;
- while (EditorApplication.isPlaying)
- {
- yield return null;
- }
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/ExitPlayMode.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/ExitPlayMode.cs.meta deleted file mode 100644 index 19c058a..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/ExitPlayMode.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 408674d91d506a54aac9a7f07951c018
-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/TestRunner/Messages/RecompileScripts.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/RecompileScripts.cs deleted file mode 100644 index 96dc8f3..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/RecompileScripts.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System;
-using System.Collections;
-using UnityEditor;
-
-namespace UnityEngine.TestTools
-{
- public class RecompileScripts : IEditModeTestYieldInstruction
- {
- public RecompileScripts() : this(true)
- {
- }
-
- public RecompileScripts(bool expectScriptCompilation) : this(expectScriptCompilation, true)
- {
- }
-
- public RecompileScripts(bool expectScriptCompilation, bool expectScriptCompilationSuccess)
- {
- ExpectScriptCompilation = expectScriptCompilation;
- ExpectScriptCompilationSuccess = expectScriptCompilationSuccess;
- ExpectDomainReload = true;
- }
-
- public bool ExpectDomainReload { get; private set; }
- public bool ExpectedPlaymodeState { get; }
- public bool ExpectScriptCompilation { get; private set; }
- public bool ExpectScriptCompilationSuccess { get; private set; }
- public static RecompileScripts Current { get; private set; }
-
- public IEnumerator Perform()
- {
- Current = this;
-
- // We need to yield, to give the test runner a chance to prepare for the domain reload
- // If the script compilation happens very fast, then EditModeRunner.MoveNextAndUpdateYieldObject will not have a chance to set m_CurrentYieldObject
- // This really should be fixed in EditModeRunner.MoveNextAndUpdateYieldObject
- yield return null;
-
- AssetDatabase.Refresh();
-
- if (ExpectScriptCompilation && !EditorApplication.isCompiling)
- {
- Current = null;
- throw new Exception("Editor does not need to recompile scripts");
- }
-
- EditorApplication.UnlockReloadAssemblies();
-
- while (EditorApplication.isCompiling)
- {
- yield return null;
- }
-
- Current = null;
-
- if (ExpectScriptCompilationSuccess && EditorUtility.scriptCompilationFailed)
- {
- EditorApplication.LockReloadAssemblies();
- throw new Exception("Script compilation failed");
- }
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/RecompileScripts.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/RecompileScripts.cs.meta deleted file mode 100644 index 07895f3..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/RecompileScripts.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 9202fbba95ea8294cb5e718f028f21b0
-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/TestRunner/Messages/WaitForDomainReload.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/WaitForDomainReload.cs deleted file mode 100644 index 19920a1..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/WaitForDomainReload.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System;
-using System.Collections;
-using UnityEditor;
-
-namespace UnityEngine.TestTools
-{
- public class WaitForDomainReload : IEditModeTestYieldInstruction
- {
- public WaitForDomainReload()
- {
- ExpectDomainReload = true;
- }
-
- public bool ExpectDomainReload { get; }
- public bool ExpectedPlaymodeState { get; }
-
- public IEnumerator Perform()
- {
- EditorApplication.UnlockReloadAssemblies();
-
- // Detect if AssetDatabase.Refresh was called (true) or if it will be called on next tick
- bool isAsync = EditorApplication.isCompiling;
-
- yield return null;
-
- if (!isAsync)
- {
- EditorApplication.LockReloadAssemblies();
- throw new Exception("Expected domain reload, but it did not occur");
- }
-
- while (EditorApplication.isCompiling)
- {
- yield return null;
- }
-
- if (EditorUtility.scriptCompilationFailed)
- {
- EditorApplication.LockReloadAssemblies();
- throw new Exception("Script compilation failed");
- }
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/WaitForDomainReload.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/WaitForDomainReload.cs.meta deleted file mode 100644 index b827ea8..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Messages/WaitForDomainReload.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 5df3c21c5237c994db89660fbdfee07d
-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/TestRunner/Utils.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils.meta deleted file mode 100644 index 9c23303..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2
-guid: 1f5bbb88ca730434483440cbc0278ef6
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/CachingTestListProvider.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/CachingTestListProvider.cs deleted file mode 100644 index 9ec2333..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/CachingTestListProvider.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System;
-using System.Collections.Generic;
-using UnityEditor.TestTools.TestRunner.Api;
-using UnityEngine.TestRunner.NUnitExtensions;
-using UnityEngine.TestTools;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class CachingTestListProvider
- {
- private readonly ITestListProvider m_InnerTestListProvider;
- private readonly ITestListCache m_TestListCache;
- private readonly ITestAdaptorFactory m_TestAdaptorFactory;
- public CachingTestListProvider(ITestListProvider innerTestListProvider, ITestListCache testListCache, ITestAdaptorFactory testAdaptorFactory)
- {
- m_InnerTestListProvider = innerTestListProvider;
- m_TestListCache = testListCache;
- m_TestAdaptorFactory = testAdaptorFactory;
- }
-
- public IEnumerator<ITestAdaptor> GetTestListAsync(TestPlatform platform)
- {
- var testFromCache = m_TestListCache.GetTestFromCacheAsync(platform);
- while (testFromCache.MoveNext())
- {
- yield return null;
- }
-
-
- if (testFromCache.Current != null)
- {
- yield return testFromCache.Current;
- }
- else
- {
- var test = m_InnerTestListProvider.GetTestListAsync(platform);
- while (test.MoveNext())
- {
- yield return null;
- }
-
- test.Current.ParseForNameDuplicates();
- m_TestListCache.CacheTest(platform, test.Current);
- yield return m_TestAdaptorFactory.Create(test.Current);
- }
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/CachingTestListProvider.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/CachingTestListProvider.cs.meta deleted file mode 100644 index 2a44a64..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/CachingTestListProvider.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 26f3e7301af463c4ca72fa98d59b429e
-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/TestRunner/Utils/EditorAssembliesProxy.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssembliesProxy.cs deleted file mode 100644 index ee0e5dc..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssembliesProxy.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Linq;
-using UnityEngine.TestTools.Utils;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class EditorAssembliesProxy : IEditorAssembliesProxy
- {
- public IAssemblyWrapper[] loadedAssemblies
- {
- get { return EditorAssemblies.loadedAssemblies.OrderBy(a => a.FullName).Select(x => new EditorAssemblyWrapper(x)).ToArray(); }
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssembliesProxy.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssembliesProxy.cs.meta deleted file mode 100644 index 711a965..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssembliesProxy.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: f96d0ea807c081145a1170ed1b6d71e0
-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/TestRunner/Utils/EditorAssemblyWrapper.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssemblyWrapper.cs deleted file mode 100644 index 8a18b12..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssemblyWrapper.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection;
-using UnityEngine.TestTools.Utils;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class EditorAssemblyWrapper : AssemblyWrapper
- {
- public EditorAssemblyWrapper(Assembly assembly)
- : base(assembly) {}
-
- public override AssemblyName[] GetReferencedAssemblies()
- {
- return Assembly.GetReferencedAssemblies();
- }
-
- public override string Location { get { return Assembly.Location; } }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssemblyWrapper.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssemblyWrapper.cs.meta deleted file mode 100644 index 14a03af..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorAssemblyWrapper.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 20cdb37e6fea6d946bbb84d2c923db85
-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/TestRunner/Utils/EditorCompilationInterfaceProxy.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorCompilationInterfaceProxy.cs deleted file mode 100644 index 5420719..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorCompilationInterfaceProxy.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEditor.Scripting.ScriptCompilation;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class EditorCompilationInterfaceProxy : IEditorCompilationInterfaceProxy
- {
- public ScriptAssembly[] GetAllEditorScriptAssemblies()
- {
- return EditorCompilationInterface.Instance.GetAllEditorScriptAssemblies(EditorCompilationInterface.GetAdditionalEditorScriptCompilationOptions());
- }
-
- public PrecompiledAssembly[] GetAllPrecompiledAssemblies()
- {
- return EditorCompilationInterface.Instance.GetAllPrecompiledAssemblies();
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorCompilationInterfaceProxy.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorCompilationInterfaceProxy.cs.meta deleted file mode 100644 index 41e354d..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorCompilationInterfaceProxy.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: c9b23632c77de204abfe8bf7168d48c0
-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/TestRunner/Utils/EditorLoadedTestAssemblyProvider.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorLoadedTestAssemblyProvider.cs deleted file mode 100644 index cffe42d..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorLoadedTestAssemblyProvider.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using UnityEditor.Scripting.ScriptCompilation;
-using UnityEngine.TestTools;
-using UnityEngine.TestTools.Utils;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class EditorLoadedTestAssemblyProvider : IEditorLoadedTestAssemblyProvider
- {
- private const string k_NunitAssemblyName = "nunit.framework";
- private const string k_TestRunnerAssemblyName = "UnityEngine.TestRunner";
- internal const string k_PerformanceTestingAssemblyName = "Unity.PerformanceTesting";
-
- private readonly IEditorAssembliesProxy m_EditorAssembliesProxy;
- private readonly ScriptAssembly[] m_AllEditorScriptAssemblies;
- private readonly PrecompiledAssembly[] m_AllPrecompiledAssemblies;
-
- public EditorLoadedTestAssemblyProvider(IEditorCompilationInterfaceProxy compilationInterfaceProxy, IEditorAssembliesProxy editorAssembliesProxy)
- {
- m_EditorAssembliesProxy = editorAssembliesProxy;
- m_AllEditorScriptAssemblies = compilationInterfaceProxy.GetAllEditorScriptAssemblies();
- m_AllPrecompiledAssemblies = compilationInterfaceProxy.GetAllPrecompiledAssemblies();
- }
-
- public List<IAssemblyWrapper> GetAssembliesGroupedByType(TestPlatform mode)
- {
- var assemblies = GetAssembliesGroupedByTypeAsync(mode);
- while (assemblies.MoveNext())
- {
- }
-
- return assemblies.Current.Where(pair => mode.IsFlagIncluded(pair.Key)).SelectMany(pair => pair.Value).ToList();
- }
-
- public IEnumerator<IDictionary<TestPlatform, List<IAssemblyWrapper>>> GetAssembliesGroupedByTypeAsync(TestPlatform mode)
- {
- IAssemblyWrapper[] loadedAssemblies = m_EditorAssembliesProxy.loadedAssemblies;
-
- IDictionary<TestPlatform, List<IAssemblyWrapper>> result = new Dictionary<TestPlatform, List<IAssemblyWrapper>>()
- {
- {TestPlatform.EditMode, new List<IAssemblyWrapper>() },
- {TestPlatform.PlayMode, new List<IAssemblyWrapper>() }
- };
-
- foreach (var loadedAssembly in loadedAssemblies)
- {
- if (loadedAssembly.GetReferencedAssemblies().Any(x => x.Name == k_NunitAssemblyName || x.Name == k_TestRunnerAssemblyName || x.Name == k_PerformanceTestingAssemblyName))
- {
- var assemblyName = new FileInfo(loadedAssembly.Location).Name;
- var scriptAssemblies = m_AllEditorScriptAssemblies.Where(x => x.Filename == assemblyName).ToList();
- var precompiledAssemblies = m_AllPrecompiledAssemblies.Where(x => new FileInfo(x.Path).Name == assemblyName).ToList();
- if (scriptAssemblies.Count < 1 && precompiledAssemblies.Count < 1)
- {
- continue;
- }
-
- var assemblyFlags = scriptAssemblies.Any() ? scriptAssemblies.Single().Flags : precompiledAssemblies.Single().Flags;
- var assemblyType = (assemblyFlags & AssemblyFlags.EditorOnly) == AssemblyFlags.EditorOnly ? TestPlatform.EditMode : TestPlatform.PlayMode;
- result[assemblyType].Add(loadedAssembly);
- yield return null;
- }
- }
-
- yield return result;
- }
- }
-}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorLoadedTestAssemblyProvider.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorLoadedTestAssemblyProvider.cs.meta deleted file mode 100644 index e2634ad..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/EditorLoadedTestAssemblyProvider.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 033c884ba52437d49bc55935939ef1c6
-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/TestRunner/Utils/IEditorAssembliesProxy.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorAssembliesProxy.cs deleted file mode 100644 index 30dc758..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorAssembliesProxy.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UnityEngine.TestTools.Utils;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal interface IEditorAssembliesProxy
- {
- IAssemblyWrapper[] loadedAssemblies { get; }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorAssembliesProxy.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorAssembliesProxy.cs.meta deleted file mode 100644 index 51988c7..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorAssembliesProxy.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 98808b11e78f6c84a841a6b4bc5a29d2
-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/TestRunner/Utils/IEditorCompilationInterfaceProxy.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorCompilationInterfaceProxy.cs deleted file mode 100644 index 330e83b..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorCompilationInterfaceProxy.cs +++ /dev/null @@ -1,10 +0,0 @@ -using UnityEditor.Scripting.ScriptCompilation;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal interface IEditorCompilationInterfaceProxy
- {
- ScriptAssembly[] GetAllEditorScriptAssemblies();
- PrecompiledAssembly[] GetAllPrecompiledAssemblies();
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorCompilationInterfaceProxy.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorCompilationInterfaceProxy.cs.meta deleted file mode 100644 index d6a3b78..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorCompilationInterfaceProxy.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 28c8fcb831e6e734a9f564bc4f495eba
-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/TestRunner/Utils/IEditorLoadedTestAssemblyProvider.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorLoadedTestAssemblyProvider.cs deleted file mode 100644 index 1e06494..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorLoadedTestAssemblyProvider.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic;
-using UnityEngine.TestTools;
-using UnityEngine.TestTools.Utils;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal interface IEditorLoadedTestAssemblyProvider
- {
- List<IAssemblyWrapper> GetAssembliesGroupedByType(TestPlatform mode);
- IEnumerator<IDictionary<TestPlatform, List<IAssemblyWrapper>>> GetAssembliesGroupedByTypeAsync(TestPlatform mode);
- }
-}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorLoadedTestAssemblyProvider.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorLoadedTestAssemblyProvider.cs.meta deleted file mode 100644 index fa0b20b..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/IEditorLoadedTestAssemblyProvider.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 936b6288befc460409cfdff3ac92fc95
-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/TestRunner/Utils/ITestListCache.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCache.cs deleted file mode 100644 index 9d61724..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCache.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic;
-using NUnit.Framework.Interfaces;
-using UnityEditor.TestTools.TestRunner.Api;
-using UnityEngine.TestTools;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- interface ITestListCache
- {
- void CacheTest(TestPlatform platform, ITest test);
- IEnumerator<ITestAdaptor> GetTestFromCacheAsync(TestPlatform platform);
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCache.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCache.cs.meta deleted file mode 100644 index 6a5a615..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCache.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: a704c010bcdb1ec4a9f3417b3c393164
-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/TestRunner/Utils/ITestListCacheData.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCacheData.cs deleted file mode 100644 index 3aa14e6..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCacheData.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic;
-using NUnit.Framework.Interfaces;
-using UnityEngine.TestRunner.TestLaunchers;
-using UnityEngine.TestTools;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- interface ITestListCacheData
- {
- List<TestPlatform> platforms { get; }
- List<ITest> cachedData { get; }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCacheData.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCacheData.cs.meta deleted file mode 100644 index fd02cd0..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListCacheData.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 7043e9a330ac2d84a80a965ada4589ad
-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/TestRunner/Utils/ITestListProvider.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListProvider.cs deleted file mode 100644 index 5657aca..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic;
-using NUnit.Framework.Interfaces;
-using UnityEngine.TestTools;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- interface ITestListProvider
- {
- IEnumerator<ITest> GetTestListAsync(TestPlatform platform);
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListProvider.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListProvider.cs.meta deleted file mode 100644 index 1d84e76..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/ITestListProvider.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 64689f8b25eadac4da519e96f514b653
-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/TestRunner/Utils/TestListCache.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCache.cs deleted file mode 100644 index 897b6b3..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCache.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Collections.Generic;
-using NUnit.Framework.Interfaces;
-using UnityEditor.TestTools.TestRunner.Api;
-using UnityEngine.TestRunner.TestLaunchers;
-using UnityEngine.TestTools;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class TestListCache : ITestListCache
- {
- private readonly ITestAdaptorFactory m_TestAdaptorFactory;
- private readonly IRemoteTestResultDataFactory m_TestResultDataFactory;
- private readonly ITestListCacheData m_TestListCacheData;
-
- public TestListCache(ITestAdaptorFactory testAdaptorFactory, IRemoteTestResultDataFactory testResultDataFactory, ITestListCacheData testListCacheData)
- {
- m_TestAdaptorFactory = testAdaptorFactory;
- m_TestResultDataFactory = testResultDataFactory;
- m_TestListCacheData = testListCacheData;
- }
-
- public void CacheTest(TestPlatform platform, ITest test)
- {
- var index = m_TestListCacheData.platforms.IndexOf(platform);
- if (index < 0)
- {
- m_TestListCacheData.cachedData.Add(test);
- m_TestListCacheData.platforms.Add(platform);
- }
- else
- {
- m_TestListCacheData.cachedData[index] = test;
- }
- }
-
- public IEnumerator<ITestAdaptor> GetTestFromCacheAsync(TestPlatform platform)
- {
- var index = m_TestListCacheData.platforms.IndexOf(platform);
- if (index < 0)
- {
- yield return null;
- yield break;
- }
-
- var testData = m_TestListCacheData.cachedData[index];
- yield return m_TestAdaptorFactory.Create(testData);
- }
-
- [Callbacks.DidReloadScripts]
- private static void ScriptReloaded()
- {
- TestListCacheData.instance.cachedData.Clear();
- TestListCacheData.instance.platforms.Clear();
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCache.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCache.cs.meta deleted file mode 100644 index fae5fd1..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCache.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: d685d97a1eb004f49afea0cc982ff728
-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/TestRunner/Utils/TestListCacheData.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCacheData.cs deleted file mode 100644 index 8081b57..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCacheData.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic;
-using NUnit.Framework.Interfaces;
-using UnityEngine;
-using UnityEngine.TestRunner.TestLaunchers;
-using UnityEngine.TestTools;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class TestListCacheData : ScriptableSingleton<TestListCacheData>, ITestListCacheData
- {
- [SerializeField]
- private List<TestPlatform> m_Platforms = new List<TestPlatform>();
-
- [SerializeField]
- private List<ITest> m_CachedData = new List<ITest>();
-
- public List<TestPlatform> platforms
- {
- get { return m_Platforms; }
- }
-
- public List<ITest> cachedData
- {
- get { return m_CachedData; }
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCacheData.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCacheData.cs.meta deleted file mode 100644 index ba5bab6..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListCacheData.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: f1b6399349763114d9361bc6dfcd025b
-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/TestRunner/Utils/TestListJob.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListJob.cs deleted file mode 100644 index 1864c78..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListJob.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System;
-using System.Collections.Generic;
-using UnityEditor.TestTools.TestRunner.Api;
-using UnityEngine.TestTools;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class TestListJob
- {
- private CachingTestListProvider m_TestListProvider;
- private TestPlatform m_Platform;
- private Action<ITestAdaptor> m_Callback;
- private IEnumerator<ITestAdaptor> m_ResultEnumerator;
- public TestListJob(CachingTestListProvider testListProvider, TestPlatform platform, Action<ITestAdaptor> callback)
- {
- m_TestListProvider = testListProvider;
- m_Platform = platform;
- m_Callback = callback;
- }
-
- public void Start()
- {
- m_ResultEnumerator = m_TestListProvider.GetTestListAsync(m_Platform);
- EditorApplication.update += EditorUpdate;
- }
-
- private void EditorUpdate()
- {
- if (!m_ResultEnumerator.MoveNext())
- {
- m_Callback(m_ResultEnumerator.Current);
- EditorApplication.update -= EditorUpdate;
- }
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListJob.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListJob.cs.meta deleted file mode 100644 index 38f8af8..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListJob.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: dec9066d4afefe444be0dad3f137730d
-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/TestRunner/Utils/TestListProvider.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListProvider.cs deleted file mode 100644 index e1402a6..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System;
-using System.Collections.Generic;
-using System.Linq;
-using NUnit.Framework.Interfaces;
-using UnityEngine.TestTools;
-using UnityEngine.TestTools.NUnitExtensions;
-
-namespace UnityEditor.TestTools.TestRunner
-{
- internal class TestListProvider : ITestListProvider
- {
- private readonly EditorLoadedTestAssemblyProvider m_AssemblyProvider;
- private readonly UnityTestAssemblyBuilder m_AssemblyBuilder;
-
- public TestListProvider(EditorLoadedTestAssemblyProvider assemblyProvider, UnityTestAssemblyBuilder assemblyBuilder)
- {
- m_AssemblyProvider = assemblyProvider;
- m_AssemblyBuilder = assemblyBuilder;
- }
-
- public IEnumerator<ITest> GetTestListAsync(TestPlatform platform)
- {
- var assembliesTask = m_AssemblyProvider.GetAssembliesGroupedByTypeAsync(platform);
- while (assembliesTask.MoveNext())
- {
- yield return null;
- }
-
- var assemblies = assembliesTask.Current.Where(pair => platform.IsFlagIncluded(pair.Key))
- .SelectMany(pair => pair.Value.Select(assemblyInfo => Tuple.Create(assemblyInfo.Assembly, pair.Key))).ToArray();
-
- var settings = UnityTestAssemblyBuilder.GetNUnitTestBuilderSettings(platform);
- var test = m_AssemblyBuilder.BuildAsync(assemblies.Select(a => a.Item1).ToArray(), assemblies.Select(a => a.Item2).ToArray(), settings);
- while (test.MoveNext())
- {
- yield return null;
- }
-
- yield return test.Current;
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListProvider.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListProvider.cs.meta deleted file mode 100644 index 975a1a3..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/TestRunner/Utils/TestListProvider.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: f15cbb987069826429540d0ea0937442
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
|
