From 7c1e566113d59699af1624186c64eca67f063fc6 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 20 Apr 2020 19:09:33 -0400 Subject: Upgraded Unity --- .../NUnitExtensions/ActionDelegator.cs | 79 ----- .../NUnitExtensions/ActionDelegator.cs.meta | 11 - .../NUnitExtensions/Attributes.meta | 8 - .../Attributes/ConditionalIgnoreAttribute.cs | 36 --- .../Attributes/ConditionalIgnoreAttribute.cs.meta | 11 - .../NUnitExtensions/Attributes/TestEnumerator.cs | 52 ---- .../Attributes/TestEnumerator.cs.meta | 11 - .../Attributes/TestMustExpectAllLogsAttribute.cs | 28 -- .../TestMustExpectAllLogsAttribute.cs.meta | 11 - .../Attributes/UnityCombinatorialStrategy.cs | 20 -- .../Attributes/UnityCombinatorialStrategy.cs.meta | 11 - .../Attributes/UnityPlatformAttribute.cs | 56 ---- .../Attributes/UnityPlatformAttribute.cs.meta | 11 - .../Attributes/UnitySetUpAttribute.cs | 10 - .../Attributes/UnitySetUpAttribute.cs.meta | 11 - .../Attributes/UnityTearDownAttribute.cs | 10 - .../Attributes/UnityTearDownAttribute.cs.meta | 11 - .../Attributes/UnityTestAttribute.cs | 33 -- .../Attributes/UnityTestAttribute.cs.meta | 11 - .../NUnitExtensions/BaseDelegator.cs | 58 ---- .../NUnitExtensions/BaseDelegator.cs.meta | 11 - .../NUnitExtensions/Commands.meta | 8 - .../Commands/BeforeAfterTestCommandBase.cs | 196 ------------ .../Commands/BeforeAfterTestCommandBase.cs.meta | 11 - .../Commands/BeforeAfterTestCommandState.cs | 49 --- .../Commands/BeforeAfterTestCommandState.cs.meta | 11 - .../EnumerableApplyChangesToContextCommand.cs | 34 -- .../EnumerableApplyChangesToContextCommand.cs.meta | 11 - .../Commands/EnumerableRepeatedTestCommand.cs | 60 ---- .../Commands/EnumerableRepeatedTestCommand.cs.meta | 11 - .../Commands/EnumerableRetryTestCommand.cs | 60 ---- .../Commands/EnumerableRetryTestCommand.cs.meta | 11 - .../Commands/EnumerableSetUpTearDownCommand.cs | 44 --- .../EnumerableSetUpTearDownCommand.cs.meta | 11 - .../Commands/EnumerableTestMethodCommand.cs | 86 ------ .../Commands/EnumerableTestMethodCommand.cs.meta | 11 - .../Commands/ImmediateEnumerableCommand.cs | 32 -- .../Commands/ImmediateEnumerableCommand.cs.meta | 11 - .../Commands/OuterUnityTestActionCommand.cs | 49 --- .../Commands/OuterUnityTestActionCommand.cs.meta | 11 - .../Commands/SetUpTearDownCommand.cs | 48 --- .../Commands/SetUpTearDownCommand.cs.meta | 11 - .../NUnitExtensions/Commands/TestActionCommand.cs | 53 ---- .../Commands/TestActionCommand.cs.meta | 11 - .../Commands/TestCommandPcHelper.cs | 18 -- .../Commands/TestCommandPcHelper.cs.meta | 11 - .../NUnitExtensions/ConstructDelegator.cs | 141 --------- .../NUnitExtensions/ConstructDelegator.cs.meta | 11 - .../NUnitExtensions/Filters.meta | 8 - .../NUnitExtensions/Filters/AssemblyNameFilter.cs | 25 -- .../Filters/AssemblyNameFilter.cs.meta | 11 - .../Filters/CategoryFilterExtended.cs | 36 --- .../Filters/CategoryFilterExtended.cs.meta | 11 - .../NUnitExtensions/IAsyncTestAssemblyBuilder.cs | 12 - .../IAsyncTestAssemblyBuilder.cs.meta | 11 - .../NUnitExtensions/IStateSerializer.cs | 12 - .../NUnitExtensions/IStateSerializer.cs.meta | 11 - .../NUnitExtensions/Runner.meta | 8 - .../NUnitExtensions/Runner/CompositeWorkItem.cs | 342 --------------------- .../Runner/CompositeWorkItem.cs.meta | 11 - .../Runner/CoroutineTestWorkItem.cs | 75 ----- .../Runner/CoroutineTestWorkItem.cs.meta | 11 - .../NUnitExtensions/Runner/DefaultTestWorkItem.cs | 96 ------ .../Runner/DefaultTestWorkItem.cs.meta | 11 - .../NUnitExtensions/Runner/FailCommand.cs | 34 -- .../NUnitExtensions/Runner/FailCommand.cs.meta | 11 - .../Runner/IEnumerableTestMethodCommand.cs | 10 - .../Runner/IEnumerableTestMethodCommand.cs.meta | 11 - .../Runner/PlaymodeWorkItemFactory.cs | 13 - .../Runner/PlaymodeWorkItemFactory.cs.meta | 11 - .../Runner/RestoreTestContextAfterDomainReload.cs | 4 - .../RestoreTestContextAfterDomainReload.cs.meta | 11 - .../NUnitExtensions/Runner/TestCommandBuilder.cs | 127 -------- .../Runner/TestCommandBuilder.cs.meta | 11 - .../Runner/UnityLogCheckDelegatingCommand.cs | 143 --------- .../Runner/UnityLogCheckDelegatingCommand.cs.meta | 11 - .../Runner/UnityTestAssemblyRunner.cs | 98 ------ .../Runner/UnityTestAssemblyRunner.cs.meta | 11 - .../Runner/UnityTestExecutionContext.cs | 130 -------- .../Runner/UnityTestExecutionContext.cs.meta | 11 - .../NUnitExtensions/Runner/UnityWorkItem.cs | 113 ------- .../NUnitExtensions/Runner/UnityWorkItem.cs.meta | 11 - .../Runner/UnityWorkItemDataHolder.cs | 10 - .../Runner/UnityWorkItemDataHolder.cs.meta | 11 - .../NUnitExtensions/Runner/WorkItemFactory.cs | 28 -- .../NUnitExtensions/Runner/WorkItemFactory.cs.meta | 11 - .../NUnitExtensions/TestExtensions.cs | 146 --------- .../NUnitExtensions/TestExtensions.cs.meta | 11 - .../NUnitExtensions/TestResultExtensions.cs | 77 ----- .../NUnitExtensions/TestResultExtensions.cs.meta | 11 - .../NUnitExtensions/UnityTestAssemblyBuilder.cs | 58 ---- .../UnityTestAssemblyBuilder.cs.meta | 11 - 92 files changed, 3357 deletions(-) delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ActionDelegator.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ActionDelegator.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/ConditionalIgnoreAttribute.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/ConditionalIgnoreAttribute.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestEnumerator.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestEnumerator.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestMustExpectAllLogsAttribute.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestMustExpectAllLogsAttribute.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityCombinatorialStrategy.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityCombinatorialStrategy.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityPlatformAttribute.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityPlatformAttribute.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnitySetUpAttribute.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnitySetUpAttribute.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTearDownAttribute.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTearDownAttribute.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTestAttribute.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTestAttribute.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/BaseDelegator.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/BaseDelegator.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandState.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandState.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableApplyChangesToContextCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableApplyChangesToContextCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRepeatedTestCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRepeatedTestCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRetryTestCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRetryTestCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableSetUpTearDownCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableSetUpTearDownCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableTestMethodCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableTestMethodCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/ImmediateEnumerableCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/ImmediateEnumerableCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/OuterUnityTestActionCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/OuterUnityTestActionCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/SetUpTearDownCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/SetUpTearDownCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestActionCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestActionCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestCommandPcHelper.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestCommandPcHelper.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ConstructDelegator.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ConstructDelegator.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/AssemblyNameFilter.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/AssemblyNameFilter.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/CategoryFilterExtended.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/CategoryFilterExtended.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IAsyncTestAssemblyBuilder.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IAsyncTestAssemblyBuilder.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IStateSerializer.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IStateSerializer.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CompositeWorkItem.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CompositeWorkItem.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CoroutineTestWorkItem.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CoroutineTestWorkItem.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/FailCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/FailCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/IEnumerableTestMethodCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/IEnumerableTestMethodCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/PlaymodeWorkItemFactory.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/PlaymodeWorkItemFactory.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/RestoreTestContextAfterDomainReload.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/RestoreTestContextAfterDomainReload.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/TestCommandBuilder.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/TestCommandBuilder.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityLogCheckDelegatingCommand.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityLogCheckDelegatingCommand.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestAssemblyRunner.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestAssemblyRunner.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestExecutionContext.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestExecutionContext.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItem.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItem.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItemDataHolder.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItemDataHolder.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/WorkItemFactory.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/WorkItemFactory.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestExtensions.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestExtensions.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs.meta delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/UnityTestAssemblyBuilder.cs delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/UnityTestAssemblyBuilder.cs.meta (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions') diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ActionDelegator.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ActionDelegator.cs deleted file mode 100644 index d13a7e0..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ActionDelegator.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Linq; -using UnityEngine.TestRunner.NUnitExtensions.Runner; -using UnityEngine.TestTools.Logging; -using UnityEngine.TestTools.TestRunner; - -namespace UnityEngine.TestTools.NUnitExtensions -{ - /// - /// This class delegates actions from the NUnit thread that should be executed on the main thread. - /// NUnit thread calls Delegate which blocks the execution on the thread until the action is executed. - /// The main thread will poll for awaiting actions (HasAction) and invoke them (Execute). - /// Once the action is executed, the main thread releases the lock and executino on the NUnit thread is continued. - /// - internal class ActionDelegator : BaseDelegator - { - private Func m_Action; - public object Delegate(Action action) - { - return Delegate(() => { action(); return null; }); - } - - public object Delegate(Func action) - { - if (m_Aborted) - { - return null; - } - - AssertState(); - m_Context = UnityTestExecutionContext.CurrentContext; - - m_Signal.Reset(); - m_Action = action; - - WaitForSignal(); - - return HandleResult(); - } - - private void AssertState() - { - if (m_Action != null) - { - throw new Exception("Action not executed yet"); - } - } - - public bool HasAction() - { - return m_Action != null; - } - - public void Execute(LogScope logScope) - { - try - { - SetCurrentTestContext(); - m_Result = m_Action(); - if (logScope.AnyFailingLogs()) - { - var failingLog = logScope.FailingLogs.First(); - throw new UnhandledLogMessageException(failingLog); - } - if (logScope.ExpectedLogs.Any()) - throw new UnexpectedLogMessageException(LogScope.Current.ExpectedLogs.Peek()); - } - catch (Exception e) - { - m_Exception = e; - } - finally - { - m_Action = null; - m_Signal.Set(); - } - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ActionDelegator.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ActionDelegator.cs.meta deleted file mode 100644 index 4800886..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ActionDelegator.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4f939b9e23a0946439b812551e07ac81 -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/UnityEngine.TestRunner/NUnitExtensions/Attributes.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes.meta deleted file mode 100644 index d2d34f6..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0cb14878543cf3d4f8472b15f7ecf0e3 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/ConditionalIgnoreAttribute.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/ConditionalIgnoreAttribute.cs deleted file mode 100644 index 3cf9714..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/ConditionalIgnoreAttribute.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections.Generic; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestTools -{ - public class ConditionalIgnoreAttribute : NUnitAttribute, IApplyToTest - { - string m_ConditionKey; - string m_IgnoreReason; - - public ConditionalIgnoreAttribute(string conditionKey, string ignoreReason) - { - m_ConditionKey = conditionKey; - m_IgnoreReason = ignoreReason; - } - - public void ApplyToTest(Test test) - { - var key = m_ConditionKey.ToLowerInvariant(); - if (m_ConditionMap.ContainsKey(key) && m_ConditionMap[key]) - { - test.RunState = RunState.Ignored; - string skipReason = string.Format(m_IgnoreReason); - test.Properties.Add(PropertyNames.SkipReason, skipReason); - } - } - - static Dictionary m_ConditionMap = new Dictionary(); - public static void AddConditionalIgnoreMapping(string key, bool value) - { - m_ConditionMap.Add(key.ToLowerInvariant(), value); - } - } -} \ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/ConditionalIgnoreAttribute.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/ConditionalIgnoreAttribute.cs.meta deleted file mode 100644 index b1601ee..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/ConditionalIgnoreAttribute.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c82a8473f4a8f7b42a004c91e06d2f2b -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/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestEnumerator.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestEnumerator.cs deleted file mode 100644 index 18bb46c..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestEnumerator.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestTools -{ - internal class TestEnumerator - { - private readonly ITestExecutionContext m_Context; - private static IEnumerator m_TestEnumerator; - - public static IEnumerator Enumerator { get { return m_TestEnumerator; } } - - public TestEnumerator(ITestExecutionContext context, IEnumerator testEnumerator) - { - m_Context = context; - m_TestEnumerator = testEnumerator; - } - - public IEnumerator Execute() - { - m_Context.CurrentResult.SetResult(ResultState.Success); - - while (true) - { - object current = null; - try - { - if (!m_TestEnumerator.MoveNext()) - { - yield break; - } - - if (!m_Context.CurrentResult.ResultState.Equals(ResultState.Success)) - { - yield break; - } - - current = m_TestEnumerator.Current; - } - catch (Exception exception) - { - m_Context.CurrentResult.RecordException(exception); - yield break; - } - yield return current; - } - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestEnumerator.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestEnumerator.cs.meta deleted file mode 100644 index 3a6022e..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestEnumerator.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 750aad009559b814dbc27001341fc1c3 -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/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestMustExpectAllLogsAttribute.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestMustExpectAllLogsAttribute.cs deleted file mode 100644 index 8f2ea0f..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestMustExpectAllLogsAttribute.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -namespace UnityEngine.TestTools -{ - /// - /// The presence of this attribute will cause the test runner to require that every single log is expected. By - /// default, the runner will only automatically fail on any error logs, so this adds warnings and infos as well. - /// It is the same as calling `LogAssert.NoUnexpectedReceived()` at the bottom of every affected test. - /// - /// This attribute can be applied to test assemblies (will affect every test in the assembly), fixtures (will - /// affect every test in the fixture), or on individual test methods. It is also automatically inherited from base - /// fixtures. - /// - /// The MustExpect property (on by default) lets you selectively enable or disable the higher level value. For - /// example when migrating an assembly to this more strict checking method, you might attach - /// `[assembly:TestMustExpectAllLogs]` to the assembly itself, but then whitelist failing fixtures and test methods - /// with `[TestMustExpectAllLogs(MustExpect=false)]` until they can be migrated. This also means new tests in that - /// assembly would be required to have the more strict checking. - /// - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] - public class TestMustExpectAllLogsAttribute : Attribute - { - public TestMustExpectAllLogsAttribute(bool mustExpect = true) - => MustExpect = mustExpect; - - public bool MustExpect { get; } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestMustExpectAllLogsAttribute.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestMustExpectAllLogsAttribute.cs.meta deleted file mode 100644 index 6ae8514..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/TestMustExpectAllLogsAttribute.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3803f736886e77842995ddbc3531afaa -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/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityCombinatorialStrategy.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityCombinatorialStrategy.cs deleted file mode 100644 index 144f78c..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityCombinatorialStrategy.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal.Builders; - -namespace UnityEngine.TestTools -{ - internal class UnityCombinatorialStrategy : CombinatorialStrategy, ICombiningStrategy - { - public new IEnumerable GetTestCases(IEnumerable[] sources) - { - var testCases = base.GetTestCases(sources); - foreach (var testCase in testCases) - { - testCase.GetType().GetProperty("ExpectedResult").SetValue(testCase, new object(), null); - } - return testCases; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityCombinatorialStrategy.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityCombinatorialStrategy.cs.meta deleted file mode 100644 index 422dd17..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityCombinatorialStrategy.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7af6ac3e6b51b8d4aab04adc85b8de2f -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/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityPlatformAttribute.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityPlatformAttribute.cs deleted file mode 100644 index 68f7816..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityPlatformAttribute.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestTools -{ - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = false)] - public class UnityPlatformAttribute : NUnitAttribute, IApplyToTest - { - public RuntimePlatform[] include { get; set; } - public RuntimePlatform[] exclude { get; set; } - - private string m_skippedReason; - - public UnityPlatformAttribute() - { - include = new List().ToArray(); - exclude = new List().ToArray(); - } - - public UnityPlatformAttribute(params RuntimePlatform[] include) - : this() - { - this.include = include; - } - - public void ApplyToTest(Test test) - { - if (test.RunState == RunState.NotRunnable || test.RunState == RunState.Ignored || IsPlatformSupported(Application.platform)) - { - return; - } - test.RunState = RunState.Skipped; - test.Properties.Add("_SKIPREASON", m_skippedReason); - } - - internal bool IsPlatformSupported(RuntimePlatform testTargetPlatform) - { - if (include.Any() && !include.Any(x => x == testTargetPlatform)) - { - m_skippedReason = string.Format("Only supported on {0}", string.Join(", ", include.Select(x => x.ToString()).ToArray())); - return false; - } - - if (exclude.Any(x => x == testTargetPlatform)) - { - m_skippedReason = string.Format("Not supported on {0}", string.Join(", ", include.Select(x => x.ToString()).ToArray())); - return false; - } - return true; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityPlatformAttribute.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityPlatformAttribute.cs.meta deleted file mode 100644 index bb41d89..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityPlatformAttribute.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5440c1153b397e14c9c7b1d6eb83b9f9 -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/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnitySetUpAttribute.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnitySetUpAttribute.cs deleted file mode 100644 index cdb8a82..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnitySetUpAttribute.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using NUnit.Framework; - -namespace UnityEngine.TestTools -{ - [AttributeUsage(AttributeTargets.Method)] - public class UnitySetUpAttribute : NUnitAttribute - { - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnitySetUpAttribute.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnitySetUpAttribute.cs.meta deleted file mode 100644 index 1668931..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnitySetUpAttribute.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: cc6401f13df54ba44bfd7cdc93c7d64d -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/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTearDownAttribute.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTearDownAttribute.cs deleted file mode 100644 index d159d39..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTearDownAttribute.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using NUnit.Framework; - -namespace UnityEngine.TestTools -{ - [AttributeUsage(AttributeTargets.Method)] - public class UnityTearDownAttribute : NUnitAttribute - { - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTearDownAttribute.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTearDownAttribute.cs.meta deleted file mode 100644 index 169eefb..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTearDownAttribute.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 600f4b74746dbf944901257f81a8af6d -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/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTestAttribute.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTestAttribute.cs deleted file mode 100644 index 5d2b5f1..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTestAttribute.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using NUnit.Framework; -using NUnit.Framework.Internal.Commands; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Builders; -using UnityEngine.TestRunner.NUnitExtensions.Runner; - -namespace UnityEngine.TestTools -{ - [AttributeUsage(AttributeTargets.Method)] - public class UnityTestAttribute : CombiningStrategyAttribute, ISimpleTestBuilder, IImplyFixture - { - public UnityTestAttribute() : base(new UnityCombinatorialStrategy(), new ParameterDataSourceProvider()) {} - - private readonly NUnitTestCaseBuilder _builder = new NUnitTestCaseBuilder(); - - TestMethod ISimpleTestBuilder.BuildFrom(IMethodInfo method, Test suite) - { - TestCaseParameters parms = new TestCaseParameters - { - ExpectedResult = new object(), - HasExpectedResult = true - }; - - var t = _builder.BuildTestMethod(method, suite, parms); - - if (t.parms != null) - t.parms.HasExpectedResult = false; - return t; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTestAttribute.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTestAttribute.cs.meta deleted file mode 100644 index a7572d4..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Attributes/UnityTestAttribute.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fedb0f9e5006b1943abae52f52f08a1a -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/UnityEngine.TestRunner/NUnitExtensions/BaseDelegator.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/BaseDelegator.cs deleted file mode 100644 index 596c000..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/BaseDelegator.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Threading; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestTools.NUnitExtensions -{ - internal abstract class BaseDelegator - { - protected ManualResetEvent m_Signal = new ManualResetEvent(false); - - protected object m_Result; - protected Exception m_Exception; - protected ITestExecutionContext m_Context; - - protected bool m_Aborted; - - protected object HandleResult() - { - SetCurrentTestContext(); - if (m_Exception != null) - { - var temp = m_Exception; - m_Exception = null; - throw temp; - } - var tempResult = m_Result; - m_Result = null; - return tempResult; - } - - protected void WaitForSignal() - { - while (!m_Signal.WaitOne(100)) - { - if (m_Aborted) - { - m_Aborted = false; - Reflect.MethodCallWrapper = null; - throw new Exception(); - } - } - } - - public void Abort() - { - m_Aborted = true; - } - - protected void SetCurrentTestContext() - { - var prop = typeof(TestExecutionContext).GetProperty("CurrentContext"); - if (prop != null) - { - prop.SetValue(null, m_Context, null); - } - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/BaseDelegator.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/BaseDelegator.cs.meta deleted file mode 100644 index 3c1a81a..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/BaseDelegator.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 37cea569bfefafe49a1513c4d7f0e9eb -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/UnityEngine.TestRunner/NUnitExtensions/Commands.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands.meta deleted file mode 100644 index 3d3cf4a..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6b72875690e0f7343911e06af3145bd5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs deleted file mode 100644 index aef740a..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs +++ /dev/null @@ -1,196 +0,0 @@ -using System; -using System.Collections; -using System.Linq; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestRunner.NUnitExtensions; -using UnityEngine.TestRunner.NUnitExtensions.Runner; -using UnityEngine.TestTools.Logging; -using UnityEngine.TestTools.TestRunner; - -namespace UnityEngine.TestTools -{ - internal abstract class BeforeAfterTestCommandBase : DelegatingTestCommand, IEnumerableTestMethodCommand - { - private string m_BeforeErrorPrefix; - private string m_AfterErrorPrefix; - private bool m_SkipYieldAfterActions; - protected BeforeAfterTestCommandBase(TestCommand innerCommand, string beforeErrorPrefix, string afterErrorPrefix, bool skipYieldAfterActions = false) - : base(innerCommand) - { - m_BeforeErrorPrefix = beforeErrorPrefix; - m_AfterErrorPrefix = afterErrorPrefix; - m_SkipYieldAfterActions = skipYieldAfterActions; - } - - protected T[] BeforeActions = new T[0]; - - protected T[] AfterActions = new T[0]; - - protected abstract IEnumerator InvokeBefore(T action, Test test, UnityTestExecutionContext context); - - protected abstract IEnumerator InvokeAfter(T action, Test test, UnityTestExecutionContext context); - - protected abstract BeforeAfterTestCommandState GetState(UnityTestExecutionContext context); - - public IEnumerable ExecuteEnumerable(ITestExecutionContext context) - { - var unityContext = (UnityTestExecutionContext)context; - var state = GetState(unityContext); - - if (state == null) - { - // We do not expect a state to exist in playmode - state = ScriptableObject.CreateInstance(); - } - - state.ApplyTestResult(context.CurrentResult); - - while (state.NextBeforeStepIndex < BeforeActions.Length) - { - var action = BeforeActions[state.NextBeforeStepIndex]; - var enumerator = InvokeBefore(action, Test, unityContext); - ActivePcHelper.SetEnumeratorPC(enumerator, state.NextBeforeStepPc); - - using (var logScope = new LogScope()) - { - while (true) - { - try - { - if (!enumerator.MoveNext()) - { - break; - } - } - catch (Exception ex) - { - state.TestHasRun = true; - context.CurrentResult.RecordPrefixedException(m_BeforeErrorPrefix, ex); - state.StoreTestResult(context.CurrentResult); - break; - } - - state.NextBeforeStepPc = ActivePcHelper.GetEnumeratorPC(enumerator); - state.StoreTestResult(context.CurrentResult); - if (m_SkipYieldAfterActions) - { - break; - } - else - { - yield return enumerator.Current; - } - } - - if (logScope.AnyFailingLogs()) - { - state.TestHasRun = true; - context.CurrentResult.RecordPrefixedError(m_BeforeErrorPrefix, new UnhandledLogMessageException(logScope.FailingLogs.First()).Message); - state.StoreTestResult(context.CurrentResult); - } - } - - state.NextBeforeStepIndex++; - state.NextBeforeStepPc = 0; - } - - if (!state.TestHasRun) - { - if (innerCommand is IEnumerableTestMethodCommand) - { - var executeEnumerable = ((IEnumerableTestMethodCommand)innerCommand).ExecuteEnumerable(context); - foreach (var iterator in executeEnumerable) - { - state.StoreTestResult(context.CurrentResult); - yield return iterator; - } - } - else - { - context.CurrentResult = innerCommand.Execute(context); - state.StoreTestResult(context.CurrentResult); - } - - state.TestHasRun = true; - } - - while (state.NextAfterStepIndex < AfterActions.Length) - { - state.TestAfterStarted = true; - var action = AfterActions[state.NextAfterStepIndex]; - var enumerator = InvokeAfter(action, Test, unityContext); - ActivePcHelper.SetEnumeratorPC(enumerator, state.NextAfterStepPc); - - using (var logScope = new LogScope()) - { - while (true) - { - try - { - if (!enumerator.MoveNext()) - { - break; - } - } - catch (Exception ex) - { - context.CurrentResult.RecordPrefixedException(m_AfterErrorPrefix, ex); - state.StoreTestResult(context.CurrentResult); - break; - } - - state.NextAfterStepPc = ActivePcHelper.GetEnumeratorPC(enumerator); - state.StoreTestResult(context.CurrentResult); - - if (m_SkipYieldAfterActions) - { - break; - } - else - { - yield return enumerator.Current; - } - } - - if (logScope.AnyFailingLogs()) - { - state.TestHasRun = true; - context.CurrentResult.RecordPrefixedError(m_AfterErrorPrefix, new UnhandledLogMessageException(logScope.FailingLogs.First()).Message); - state.StoreTestResult(context.CurrentResult); - } - } - - state.NextAfterStepIndex++; - state.NextAfterStepPc = 0; - } - - state.Reset(); - } - - public override TestResult Execute(ITestExecutionContext context) - { - throw new NotImplementedException("Use ExecuteEnumerable"); - } - - private static TestCommandPcHelper pcHelper; - - internal static TestCommandPcHelper ActivePcHelper - { - get - { - if (pcHelper == null) - { - pcHelper = new TestCommandPcHelper(); - } - - return pcHelper; - } - set - { - pcHelper = value; - } - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs.meta deleted file mode 100644 index 21b2681..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: cbbca1d8a0434be4bbc7f165523763ac -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/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandState.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandState.cs deleted file mode 100644 index daed396..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandState.cs +++ /dev/null @@ -1,49 +0,0 @@ -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestTools -{ - internal class BeforeAfterTestCommandState : ScriptableObject - { - public int NextBeforeStepIndex; - public int NextBeforeStepPc; - public int NextAfterStepIndex; - public int NextAfterStepPc; - public bool TestHasRun; - public TestStatus CurrentTestResultStatus; - public string CurrentTestResultLabel; - public FailureSite CurrentTestResultSite; - public string CurrentTestMessage; - public string CurrentTestStrackTrace; - public bool TestAfterStarted; - - public void Reset() - { - NextBeforeStepIndex = 0; - NextBeforeStepPc = 0; - NextAfterStepIndex = 0; - NextAfterStepPc = 0; - TestHasRun = false; - CurrentTestResultStatus = TestStatus.Inconclusive; - CurrentTestResultLabel = null; - CurrentTestResultSite = default(FailureSite); - CurrentTestMessage = null; - CurrentTestStrackTrace = null; - TestAfterStarted = false; - } - - public void StoreTestResult(TestResult result) - { - CurrentTestResultStatus = result.ResultState.Status; - CurrentTestResultLabel = result.ResultState.Label; - CurrentTestResultSite = result.ResultState.Site; - CurrentTestMessage = result.Message; - CurrentTestStrackTrace = result.StackTrace; - } - - public void ApplyTestResult(TestResult result) - { - result.SetResult(new ResultState(CurrentTestResultStatus, CurrentTestResultLabel, CurrentTestResultSite), CurrentTestMessage, CurrentTestStrackTrace); - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandState.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandState.cs.meta deleted file mode 100644 index 8e304ac..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandState.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7f65567c9026afb4db5de3355accc636 -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/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableApplyChangesToContextCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableApplyChangesToContextCommand.cs deleted file mode 100644 index 81a672a..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableApplyChangesToContextCommand.cs +++ /dev/null @@ -1,34 +0,0 @@ - -using System.Collections; -using System.Collections.Generic; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestRunner.NUnitExtensions.Runner; - -namespace UnityEngine.TestTools -{ - internal class EnumerableApplyChangesToContextCommand : ApplyChangesToContextCommand, IEnumerableTestMethodCommand - { - public EnumerableApplyChangesToContextCommand(TestCommand innerCommand, IEnumerable changes) - : base(innerCommand, changes) { } - - public IEnumerable ExecuteEnumerable(ITestExecutionContext context) - { - ApplyChanges(context); - - if (innerCommand is IEnumerableTestMethodCommand) - { - var executeEnumerable = ((IEnumerableTestMethodCommand)innerCommand).ExecuteEnumerable(context); - foreach (var iterator in executeEnumerable) - { - yield return iterator; - } - } - else - { - context.CurrentResult = innerCommand.Execute(context); - } - } - } -} \ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableApplyChangesToContextCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableApplyChangesToContextCommand.cs.meta deleted file mode 100644 index f652088..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableApplyChangesToContextCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3b4429eff9fcffb48b006e8edcc90338 -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/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRepeatedTestCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRepeatedTestCommand.cs deleted file mode 100644 index a692d78..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRepeatedTestCommand.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestRunner.NUnitExtensions.Runner; - -namespace UnityEngine.TestTools -{ - internal class EnumerableRepeatedTestCommand : DelegatingTestCommand, IEnumerableTestMethodCommand - { - private int repeatCount; - - public EnumerableRepeatedTestCommand(RepeatAttribute.RepeatedTestCommand commandToReplace) : base(commandToReplace.GetInnerCommand()) - { - repeatCount = (int) typeof(RepeatAttribute.RepeatedTestCommand) - .GetField("repeatCount", BindingFlags.NonPublic | BindingFlags.Instance) - .GetValue(commandToReplace); - } - - public override TestResult Execute(ITestExecutionContext context) - { - throw new NotImplementedException("Use ExecuteEnumerable"); - } - - public IEnumerable ExecuteEnumerable(ITestExecutionContext context) - { - var unityContext = (UnityTestExecutionContext)context; - int count = unityContext.EnumerableRepeatedTestState; - - while (count < repeatCount) - { - count++; - unityContext.EnumerableRepeatedTestState = count; - - if (innerCommand is IEnumerableTestMethodCommand) - { - var executeEnumerable = ((IEnumerableTestMethodCommand)innerCommand).ExecuteEnumerable(context); - foreach (var iterator in executeEnumerable) - { - yield return iterator; - } - } - else - { - context.CurrentResult = innerCommand.Execute(context); - } - - if (context.CurrentResult.ResultState != ResultState.Success) - { - break; - } - } - - unityContext.EnumerableRepeatedTestState = 0; - } - } -} \ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRepeatedTestCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRepeatedTestCommand.cs.meta deleted file mode 100644 index 121fb18..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRepeatedTestCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e273462feb9a65948826739f683cc9a9 -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/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRetryTestCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRetryTestCommand.cs deleted file mode 100644 index 2dbe145..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRetryTestCommand.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestRunner.NUnitExtensions.Runner; - -namespace UnityEngine.TestTools -{ - internal class EnumerableRetryTestCommand : DelegatingTestCommand, IEnumerableTestMethodCommand - { - private int retryCount; - - public EnumerableRetryTestCommand(RetryAttribute.RetryCommand commandToReplace) : base(commandToReplace.GetInnerCommand()) - { - retryCount = (int) typeof(RetryAttribute.RetryCommand) - .GetField("_retryCount", BindingFlags.NonPublic | BindingFlags.Instance) - .GetValue(commandToReplace); - } - - public override TestResult Execute(ITestExecutionContext context) - { - throw new NotImplementedException("Use ExecuteEnumerable"); - } - - public IEnumerable ExecuteEnumerable(ITestExecutionContext context) - { - var unityContext = (UnityTestExecutionContext)context; - int count = unityContext.EnumerableRetryTestState; - - while (count < retryCount) - { - count++; - unityContext.EnumerableRetryTestState = count; - - if (innerCommand is IEnumerableTestMethodCommand) - { - var executeEnumerable = ((IEnumerableTestMethodCommand)innerCommand).ExecuteEnumerable(context); - foreach (var iterator in executeEnumerable) - { - yield return iterator; - } - } - else - { - context.CurrentResult = innerCommand.Execute(context); - } - - if (context.CurrentResult.ResultState != ResultState.Failure) - { - break; - } - } - - unityContext.EnumerableRetryTestState = 0; - } - } -} \ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRetryTestCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRetryTestCommand.cs.meta deleted file mode 100644 index da1781c..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableRetryTestCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6de2f178a24cd2e48a0816cacd9a0583 -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/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableSetUpTearDownCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableSetUpTearDownCommand.cs deleted file mode 100644 index e4010c0..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableSetUpTearDownCommand.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections; -using System.Linq; -using System.Reflection; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestRunner.NUnitExtensions.Runner; - -namespace UnityEngine.TestTools -{ - internal class EnumerableSetUpTearDownCommand : BeforeAfterTestCommandBase - { - public EnumerableSetUpTearDownCommand(TestCommand innerCommand) - : base(innerCommand, "SetUp", "TearDown") - { - if (Test.TypeInfo.Type != null) - { - BeforeActions = GetMethodsWithAttributeFromFixture(Test.TypeInfo.Type, typeof(UnitySetUpAttribute)); - AfterActions = GetMethodsWithAttributeFromFixture(Test.TypeInfo.Type, typeof(UnityTearDownAttribute)).Reverse().ToArray(); - } - } - - private static MethodInfo[] GetMethodsWithAttributeFromFixture(Type fixtureType, Type setUpType) - { - MethodInfo[] methodsWithAttribute = Reflect.GetMethodsWithAttribute(fixtureType, setUpType, true); - return methodsWithAttribute.Where(x => x.ReturnType == typeof(IEnumerator)).ToArray(); - } - - protected override IEnumerator InvokeBefore(MethodInfo action, Test test, UnityTestExecutionContext context) - { - return (IEnumerator)Reflect.InvokeMethod(action, context.TestObject); - } - - protected override IEnumerator InvokeAfter(MethodInfo action, Test test, UnityTestExecutionContext context) - { - return (IEnumerator)Reflect.InvokeMethod(action, context.TestObject); - } - - protected override BeforeAfterTestCommandState GetState(UnityTestExecutionContext context) - { - return context.SetUpTearDownState; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableSetUpTearDownCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableSetUpTearDownCommand.cs.meta deleted file mode 100644 index 2d1f6b7..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableSetUpTearDownCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dd85a35169d313840a0874aea1a28629 -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/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableTestMethodCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableTestMethodCommand.cs deleted file mode 100644 index 17be307..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableTestMethodCommand.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using NUnit.Framework.Internal.Execution; -using UnityEngine.TestRunner.NUnitExtensions.Runner; -using UnityEngine.TestTools.TestRunner; - -namespace UnityEngine.TestTools -{ - internal class EnumerableTestMethodCommand : TestCommand, IEnumerableTestMethodCommand - { - private readonly TestMethod testMethod; - - public EnumerableTestMethodCommand(TestMethod testMethod) - : base(testMethod) - { - this.testMethod = testMethod; - } - - public IEnumerable ExecuteEnumerable(ITestExecutionContext context) - { - yield return null; - - var currentExecutingTestEnumerator = new TestEnumeratorWrapper(testMethod).GetEnumerator(context); - if (currentExecutingTestEnumerator != null) - { - var testEnumeraterYieldInstruction = new TestEnumerator(context, currentExecutingTestEnumerator); - - yield return testEnumeraterYieldInstruction; - - var enumerator = testEnumeraterYieldInstruction.Execute(); - - var executingEnumerator = ExecuteEnumerableAndRecordExceptions(enumerator, context); - while (executingEnumerator.MoveNext()) - { - yield return executingEnumerator.Current; - } - } - else - { - if (context.CurrentResult.ResultState != ResultState.Ignored) - { - context.CurrentResult.SetResult(ResultState.Success); - } - } - } - - private static IEnumerator ExecuteEnumerableAndRecordExceptions(IEnumerator enumerator, ITestExecutionContext context) - { - while (true) - { - try - { - if (!enumerator.MoveNext()) - { - break; - } - } - catch (Exception ex) - { - context.CurrentResult.RecordException(ex); - break; - } - - if (enumerator.Current is IEnumerator) - { - var current = (IEnumerator)enumerator.Current; - yield return ExecuteEnumerableAndRecordExceptions(current, context); - } - else - { - yield return enumerator.Current; - } - } - } - - public override TestResult Execute(ITestExecutionContext context) - { - throw new NotImplementedException("Use ExecuteEnumerable"); - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableTestMethodCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableTestMethodCommand.cs.meta deleted file mode 100644 index d9b61f0..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/EnumerableTestMethodCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 19a6f000f81e24c4a826c1abd43e77c7 -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/UnityEngine.TestRunner/NUnitExtensions/Commands/ImmediateEnumerableCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/ImmediateEnumerableCommand.cs deleted file mode 100644 index a50a95e..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/ImmediateEnumerableCommand.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestRunner.NUnitExtensions.Runner; - -namespace UnityEngine.TestTools -{ - internal class ImmediateEnumerableCommand : DelegatingTestCommand - { - public ImmediateEnumerableCommand(TestCommand innerCommand) - : base(innerCommand) { } - - public override TestResult Execute(ITestExecutionContext context) - { - if (innerCommand is IEnumerableTestMethodCommand) - { - var executeEnumerable = ((IEnumerableTestMethodCommand)innerCommand).ExecuteEnumerable(context); - foreach (var iterator in executeEnumerable) - { - if (iterator != null) - { - throw new Exception("Only null can be yielded at this point."); - } - } - return context.CurrentResult; - } - - return innerCommand.Execute(context); - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/ImmediateEnumerableCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/ImmediateEnumerableCommand.cs.meta deleted file mode 100644 index ec993f6..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/ImmediateEnumerableCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8349e42a2b30c7a4abd8678c203428ba -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/UnityEngine.TestRunner/NUnitExtensions/Commands/OuterUnityTestActionCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/OuterUnityTestActionCommand.cs deleted file mode 100644 index 34c2d21..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/OuterUnityTestActionCommand.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestRunner.NUnitExtensions.Runner; - -namespace UnityEngine.TestTools -{ - internal class OuterUnityTestActionCommand : BeforeAfterTestCommandBase - { - public OuterUnityTestActionCommand(TestCommand innerCommand) - : base(innerCommand, "BeforeTest", "AfterTest") - { - if (Test.TypeInfo.Type != null) - { - BeforeActions = GetUnityTestActionsFromMethod(Test.Method.MethodInfo); - AfterActions = BeforeActions; - } - } - - private static IOuterUnityTestAction[] GetUnityTestActionsFromMethod(MethodInfo method) - { - var attributes = method.GetCustomAttributes(false); - List actions = new List(); - foreach (var attribute in attributes) - { - if (attribute is IOuterUnityTestAction) - actions.Add(attribute as IOuterUnityTestAction); - } - return actions.ToArray(); - } - - protected override IEnumerator InvokeBefore(IOuterUnityTestAction action, Test test, UnityTestExecutionContext context) - { - return action.BeforeTest(test); - } - - protected override IEnumerator InvokeAfter(IOuterUnityTestAction action, Test test, UnityTestExecutionContext context) - { - return action.AfterTest(test); - } - - protected override BeforeAfterTestCommandState GetState(UnityTestExecutionContext context) - { - return context.OuterUnityTestActionState; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/OuterUnityTestActionCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/OuterUnityTestActionCommand.cs.meta deleted file mode 100644 index 321a388..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/OuterUnityTestActionCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 0d4fc309a0784294c8ab658b53b12320 -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/UnityEngine.TestRunner/NUnitExtensions/Commands/SetUpTearDownCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/SetUpTearDownCommand.cs deleted file mode 100644 index b0f96cc..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/SetUpTearDownCommand.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections; -using System.Linq; -using System.Reflection; -using NUnit.Framework; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using NUnit.Framework.Internal.Execution; -using UnityEngine.TestRunner.NUnitExtensions.Runner; - -namespace UnityEngine.TestTools -{ - internal class SetUpTearDownCommand : BeforeAfterTestCommandBase - { - public SetUpTearDownCommand(TestCommand innerCommand) - : base(innerCommand, "SetUp", "TearDown", true) - { - if (Test.TypeInfo.Type != null) - { - BeforeActions = GetMethodsWithAttributeFromFixture(Test.TypeInfo.Type, typeof(SetUpAttribute)); - AfterActions = GetMethodsWithAttributeFromFixture(Test.TypeInfo.Type, typeof(TearDownAttribute)).Reverse().ToArray(); - } - } - - private static MethodInfo[] GetMethodsWithAttributeFromFixture(Type fixtureType, Type setUpType) - { - MethodInfo[] methodsWithAttribute = Reflect.GetMethodsWithAttribute(fixtureType, setUpType, true); - return methodsWithAttribute.Where(x => x.ReturnType == typeof(void)).ToArray(); - } - - protected override IEnumerator InvokeBefore(MethodInfo action, Test test, UnityTestExecutionContext context) - { - Reflect.InvokeMethod(action, context.TestObject); - yield return null; - } - - protected override IEnumerator InvokeAfter(MethodInfo action, Test test, UnityTestExecutionContext context) - { - Reflect.InvokeMethod(action, context.TestObject); - yield return null; - } - - protected override BeforeAfterTestCommandState GetState(UnityTestExecutionContext context) - { - return null; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/SetUpTearDownCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/SetUpTearDownCommand.cs.meta deleted file mode 100644 index fbcea8b..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/SetUpTearDownCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e0db3f3921670cd4ca2e925737c3fba4 -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/UnityEngine.TestRunner/NUnitExtensions/Commands/TestActionCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestActionCommand.cs deleted file mode 100644 index 2b08fe1..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestActionCommand.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using NUnit.Framework; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestRunner.NUnitExtensions.Runner; - -namespace UnityEngine.TestTools -{ - internal class TestActionCommand : BeforeAfterTestCommandBase - { - public TestActionCommand(TestCommand innerCommand) - : base(innerCommand, "BeforeTest", "AfterTest", true) - { - if (Test.TypeInfo.Type != null) - { - BeforeActions = GetTestActionsFromMethod(Test.Method.MethodInfo); - AfterActions = BeforeActions; - } - } - - private static ITestAction[] GetTestActionsFromMethod(MethodInfo method) - { - var attributes = method.GetCustomAttributes(false); - List actions = new List(); - foreach (var attribute in attributes) - { - if (attribute is ITestAction) - actions.Add(attribute as ITestAction); - } - return actions.ToArray(); - } - - protected override IEnumerator InvokeBefore(ITestAction action, Test test, UnityTestExecutionContext context) - { - action.BeforeTest(test); - yield return null; - } - - protected override IEnumerator InvokeAfter(ITestAction action, Test test, UnityTestExecutionContext context) - { - action.AfterTest(test); - yield return null; - } - - protected override BeforeAfterTestCommandState GetState(UnityTestExecutionContext context) - { - return null; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestActionCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestActionCommand.cs.meta deleted file mode 100644 index 0349788..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestActionCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2de8ba3b840049641897e0da7ce1d5cd -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/UnityEngine.TestRunner/NUnitExtensions/Commands/TestCommandPcHelper.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestCommandPcHelper.cs deleted file mode 100644 index 62dc806..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestCommandPcHelper.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections; - -namespace UnityEngine.TestTools -{ - internal class TestCommandPcHelper - { - public virtual void SetEnumeratorPC(IEnumerator enumerator, int pc) - { - // Noop implementation used in playmode. - } - - public virtual int GetEnumeratorPC(IEnumerator enumerator) - { - return 0; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestCommandPcHelper.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestCommandPcHelper.cs.meta deleted file mode 100644 index 6f8f8f8..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Commands/TestCommandPcHelper.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 33e6b78c96bb0694e96383e3c56b7b54 -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/UnityEngine.TestRunner/NUnitExtensions/ConstructDelegator.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ConstructDelegator.cs deleted file mode 100644 index 1a6dd61..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ConstructDelegator.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; -using System.Linq; -using NUnit.Framework.Internal; -using UnityEngine.TestRunner.NUnitExtensions.Runner; -using UnityEngine.TestTools.Logging; -using UnityEngine.TestTools.TestRunner; - -namespace UnityEngine.TestTools.NUnitExtensions -{ - /// - /// Specialization of BaseDelegator that makes sure objects are created on the MainThread. - /// It also deals with ScriptableObjects so that tests can survive assembly reload. - /// - internal class ConstructDelegator - { - private Type m_RequestedType; - private object[] m_Arguments; - - private ScriptableObject m_CurrentRunningTest; - private readonly IStateSerializer m_StateSerializer; - - protected Exception m_Exception; - protected object m_Result; - protected ITestExecutionContext m_Context; - - public ConstructDelegator(IStateSerializer stateSerializer) - { - m_StateSerializer = stateSerializer; - } - - protected object HandleResult() - { - SetCurrentTestContext(); - if (m_Exception != null) - { - var temp = m_Exception; - m_Exception = null; - throw temp; - } - var tempResult = m_Result; - m_Result = null; - return tempResult; - } - - protected void SetCurrentTestContext() - { - var prop = typeof(UnityTestExecutionContext).GetProperty("CurrentContext"); - if (prop != null) - { - prop.SetValue(null, m_Context, null); - } - } - - public object Delegate(Type type, object[] arguments) - { - AssertState(); - m_Context = UnityTestExecutionContext.CurrentContext; - - m_RequestedType = type; - m_Arguments = arguments; - - using (var logScope = new LogScope()) - { - Execute(logScope); - } - - return HandleResult(); - } - - private void AssertState() - { - if (m_RequestedType != null) - { - throw new Exception("Constructor not executed yet"); - } - } - - public bool HasAction() - { - return m_RequestedType != null; - } - - public void Execute(LogScope logScope) - { - try - { - if (typeof(ScriptableObject).IsAssignableFrom(m_RequestedType)) - { - if (m_CurrentRunningTest != null && m_RequestedType != m_CurrentRunningTest.GetType()) - { - DestroyCurrentTestObjectIfExists(); - } - if (m_CurrentRunningTest == null) - { - if (m_StateSerializer.CanRestoreFromScriptableObject(m_RequestedType)) - { - m_CurrentRunningTest = m_StateSerializer.RestoreScriptableObjectInstance(); - } - else - { - m_CurrentRunningTest = ScriptableObject.CreateInstance(m_RequestedType); - } - } - m_Result = m_CurrentRunningTest; - } - else - { - DestroyCurrentTestObjectIfExists(); - m_Result = Activator.CreateInstance(m_RequestedType, m_Arguments); - if (m_StateSerializer.CanRestoreFromJson(m_RequestedType)) - { - m_StateSerializer.RestoreClassFromJson(ref m_Result); - } - } - if (logScope.AnyFailingLogs()) - { - var failingLog = logScope.FailingLogs.First(); - throw new UnhandledLogMessageException(failingLog); - } - if (logScope.ExpectedLogs.Any()) - throw new UnexpectedLogMessageException(LogScope.Current.ExpectedLogs.Peek()); - } - catch (Exception e) - { - m_Exception = e; - } - finally - { - m_RequestedType = null; - m_Arguments = null; - } - } - - public void DestroyCurrentTestObjectIfExists() - { - if (m_CurrentRunningTest == null) - return; - Object.DestroyImmediate(m_CurrentRunningTest); - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ConstructDelegator.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ConstructDelegator.cs.meta deleted file mode 100644 index dbd68a8..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/ConstructDelegator.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b42e1db66fe9c634798674cb9e1df2ca -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/UnityEngine.TestRunner/NUnitExtensions/Filters.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters.meta deleted file mode 100644 index 7cad26c..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c3de99f9efc582a48995bc8e8c2df418 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/AssemblyNameFilter.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/AssemblyNameFilter.cs deleted file mode 100644 index a1f6803..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/AssemblyNameFilter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal.Filters; - -namespace UnityEngine.TestRunner.NUnitExtensions.Filters -{ - internal class AssemblyNameFilter : ValueMatchFilter - { - public AssemblyNameFilter(string assemblyName) : base(assemblyName) {} - - public override bool Match(ITest test) - { - string assemblyName = string.Empty; - //Assembly fullname is in the format "Assembly-name, meta data ...", so extract the name by looking for the comma - if (test.TypeInfo != null && test.TypeInfo.Assembly != null && test.TypeInfo.FullName != null) - assemblyName = test.TypeInfo.Assembly.FullName.Substring(0, test.TypeInfo.Assembly.FullName.IndexOf(',')).TrimEnd(','); - return ExpectedValue.Equals(assemblyName, StringComparison.OrdinalIgnoreCase); - } - - protected override string ElementName - { - get { return "id"; } - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/AssemblyNameFilter.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/AssemblyNameFilter.cs.meta deleted file mode 100644 index bee56e6..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/AssemblyNameFilter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 91319408591cec1478efd3c62f9f418a -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/UnityEngine.TestRunner/NUnitExtensions/Filters/CategoryFilterExtended.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/CategoryFilterExtended.cs deleted file mode 100644 index f060d47..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/CategoryFilterExtended.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections; -using System.Linq; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Filters; - -namespace UnityEngine.TestRunner.NUnitExtensions.Filters -{ - internal class CategoryFilterExtended : CategoryFilter - { - public static string k_DefaultCategory = "Uncategorized"; - - public CategoryFilterExtended(string name) : base(name) - { - } - - public override bool Match(ITest test) - { - IList testCategories = test.Properties[PropertyNames.Category].Cast().ToList(); - - if (test is TestMethod) - { - // Do not count tests with no attribute as Uncategorized if test fixture class has at least one attribute - // The test inherits the attribute from the test fixture - IList fixtureCategories = test.Parent.Properties[PropertyNames.Category].Cast().ToList(); - if (fixtureCategories.Count > 0) - return false; - } - - if (testCategories.Count == 0 && ExpectedValue == k_DefaultCategory && test is TestMethod) - return true; - - return base.Match(test); - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/CategoryFilterExtended.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/CategoryFilterExtended.cs.meta deleted file mode 100644 index 8ff1134..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Filters/CategoryFilterExtended.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ebeedaa04bb53e24ba2e7fb6745e3fd3 -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/UnityEngine.TestRunner/NUnitExtensions/IAsyncTestAssemblyBuilder.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IAsyncTestAssemblyBuilder.cs deleted file mode 100644 index 9058d9f..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IAsyncTestAssemblyBuilder.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; -using System.Reflection; -using NUnit.Framework.Api; -using NUnit.Framework.Interfaces; - -namespace UnityEngine.TestTools.NUnitExtensions -{ - internal interface IAsyncTestAssemblyBuilder : ITestAssemblyBuilder - { - IEnumerator BuildAsync(Assembly[] assemblies, TestPlatform[] testPlatforms, IDictionary options); - } -} \ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IAsyncTestAssemblyBuilder.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IAsyncTestAssemblyBuilder.cs.meta deleted file mode 100644 index e22e4e8..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IAsyncTestAssemblyBuilder.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c3aa5c3d59b94854e843f10b75b3ad63 -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/UnityEngine.TestRunner/NUnitExtensions/IStateSerializer.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IStateSerializer.cs deleted file mode 100644 index d4a3338..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IStateSerializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace UnityEngine.TestTools.NUnitExtensions -{ - internal interface IStateSerializer - { - ScriptableObject RestoreScriptableObjectInstance(); - void RestoreClassFromJson(ref object instance); - bool CanRestoreFromJson(Type requestedType); - bool CanRestoreFromScriptableObject(Type requestedType); - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IStateSerializer.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IStateSerializer.cs.meta deleted file mode 100644 index 350aa38..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/IStateSerializer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5f875a14565308a40a5262d2504da705 -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/UnityEngine.TestRunner/NUnitExtensions/Runner.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner.meta deleted file mode 100644 index 718bce8..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 37888acc09d9ee848bf9559f06645c45 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CompositeWorkItem.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CompositeWorkItem.cs deleted file mode 100644 index 2efbd86..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CompositeWorkItem.cs +++ /dev/null @@ -1,342 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using NUnit.Framework.Internal.Execution; -using UnityEngine.TestTools.Logging; -using UnityEngine.TestTools.TestRunner; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal class CompositeWorkItem : UnityWorkItem - { - private readonly TestSuite _suite; - private readonly TestSuiteResult _suiteResult; - private readonly ITestFilter _childFilter; - private TestCommand _setupCommand; - private TestCommand _teardownCommand; - - public List Children { get; private set; } - - private int _countOrder; - - private CountdownEvent _childTestCountdown; - - public CompositeWorkItem(TestSuite suite, ITestFilter childFilter, WorkItemFactory factory) - : base(suite, factory) - { - _suite = suite; - _suiteResult = Result as TestSuiteResult; - _childFilter = childFilter; - _countOrder = 0; - } - - protected override IEnumerable PerformWork() - { - InitializeSetUpAndTearDownCommands(); - - if (UnityTestExecutionContext.CurrentContext != null && m_DontRunRestoringResult && EditModeTestCallbacks.RestoringTestContext != null) - { - EditModeTestCallbacks.RestoringTestContext(); - } - - if (!CheckForCancellation()) - if (Test.RunState == RunState.Explicit && !_childFilter.IsExplicitMatch(Test)) - SkipFixture(ResultState.Explicit, GetSkipReason(), null); - else - switch (Test.RunState) - { - default: - case RunState.Runnable: - case RunState.Explicit: - Result.SetResult(ResultState.Success); - - CreateChildWorkItems(); - - if (Children.Count > 0) - { - if (!m_DontRunRestoringResult) - { - //This is needed to give the editor a chance to go out of playmode if needed before creating objects. - //If we do not, the objects could be automatically destroyed when exiting playmode and could result in errors later on - yield return null; - PerformOneTimeSetUp(); - } - - if (!CheckForCancellation()) - { - switch (Result.ResultState.Status) - { - case TestStatus.Passed: - foreach (var child in RunChildren()) - { - if (CheckForCancellation()) - { - yield break; - } - - yield return child; - } - break; - case TestStatus.Skipped: - case TestStatus.Inconclusive: - case TestStatus.Failed: - SkipChildren(_suite, Result.ResultState.WithSite(FailureSite.Parent), "OneTimeSetUp: " + Result.Message); - break; - } - } - - if (Context.ExecutionStatus != TestExecutionStatus.AbortRequested && !m_DontRunRestoringResult) - { - PerformOneTimeTearDown(); - } - } - break; - - case RunState.Skipped: - SkipFixture(ResultState.Skipped, GetSkipReason(), null); - break; - - case RunState.Ignored: - SkipFixture(ResultState.Ignored, GetSkipReason(), null); - break; - - case RunState.NotRunnable: - SkipFixture(ResultState.NotRunnable, GetSkipReason(), GetProviderStackTrace()); - break; - } - if (!ResultedInDomainReload) - { - WorkItemComplete(); - } - } - - private bool CheckForCancellation() - { - if (Context.ExecutionStatus != TestExecutionStatus.Running) - { - Result.SetResult(ResultState.Cancelled, "Test cancelled by user"); - return true; - } - - return false; - } - - private void InitializeSetUpAndTearDownCommands() - { - List setUpTearDownItems = _suite.TypeInfo != null - ? CommandBuilder.BuildSetUpTearDownList(_suite.TypeInfo.Type, typeof(OneTimeSetUpAttribute), typeof(OneTimeTearDownAttribute)) - : new List(); - - var actionItems = new List(); - foreach (ITestAction action in Actions) - { - bool applyToSuite = (action.Targets & ActionTargets.Suite) == ActionTargets.Suite - || action.Targets == ActionTargets.Default && !(Test is ParameterizedMethodSuite); - - bool applyToTest = (action.Targets & ActionTargets.Test) == ActionTargets.Test - && !(Test is ParameterizedMethodSuite); - - if (applyToSuite) - actionItems.Add(new TestActionItem(action)); - - if (applyToTest) - Context.UpstreamActions.Add(action); - } - - _setupCommand = CommandBuilder.MakeOneTimeSetUpCommand(_suite, setUpTearDownItems, actionItems); - _teardownCommand = CommandBuilder.MakeOneTimeTearDownCommand(_suite, setUpTearDownItems, actionItems); - } - - private void PerformOneTimeSetUp() - { - var logScope = new LogScope(); - try - { - _setupCommand.Execute(Context); - } - catch (Exception ex) - { - if (ex is NUnitException || ex is TargetInvocationException) - ex = ex.InnerException; - - Result.RecordException(ex, FailureSite.SetUp); - } - - if (logScope.AnyFailingLogs()) - { - Result.RecordException(new UnhandledLogMessageException(logScope.FailingLogs.First())); - } - logScope.Dispose(); - } - - private IEnumerable RunChildren() - { - int childCount = Children.Count; - if (childCount == 0) - throw new InvalidOperationException("RunChildren called but item has no children"); - - _childTestCountdown = new CountdownEvent(childCount); - - foreach (UnityWorkItem child in Children) - { - if (CheckForCancellation()) - { - yield break; - } - - var unityTestExecutionContext = new UnityTestExecutionContext(Context); - child.InitializeContext(unityTestExecutionContext); - - var enumerable = child.Execute().GetEnumerator(); - - while (true) - { - if (!enumerable.MoveNext()) - { - break; - } - ResultedInDomainReload |= child.ResultedInDomainReload; - yield return enumerable.Current; - } - - _suiteResult.AddResult(child.Result); - childCount--; - } - - if (childCount > 0) - { - while (childCount-- > 0) - CountDownChildTest(); - } - } - - private void CreateChildWorkItems() - { - Children = new List(); - var testSuite = _suite; - - foreach (ITest test in testSuite.Tests) - { - if (_childFilter.Pass(test)) - { - var child = m_Factory.Create(test, _childFilter); - - if (test.Properties.ContainsKey(PropertyNames.Order)) - { - Children.Insert(0, child); - _countOrder++; - } - else - { - Children.Add(child); - } - } - } - - if (_countOrder != 0) SortChildren(); - } - - private class UnityWorkItemOrderComparer : IComparer - { - public int Compare(UnityWorkItem x, UnityWorkItem y) - { - var xKey = int.MaxValue; - var yKey = int.MaxValue; - - if (x.Test.Properties.ContainsKey(PropertyNames.Order)) - xKey = (int)x.Test.Properties[PropertyNames.Order][0]; - - if (y.Test.Properties.ContainsKey(PropertyNames.Order)) - yKey = (int)y.Test.Properties[PropertyNames.Order][0]; - - return xKey.CompareTo(yKey); - } - } - - private void SortChildren() - { - Children.Sort(0, _countOrder, new UnityWorkItemOrderComparer()); - } - - private void SkipFixture(ResultState resultState, string message, string stackTrace) - { - Result.SetResult(resultState.WithSite(FailureSite.SetUp), message, StackFilter.Filter(stackTrace)); - SkipChildren(_suite, resultState.WithSite(FailureSite.Parent), "OneTimeSetUp: " + message); - } - - private void SkipChildren(TestSuite suite, ResultState resultState, string message) - { - foreach (Test child in suite.Tests) - { - if (_childFilter.Pass(child)) - { - Context.Listener.TestStarted(child); - TestResult childResult = child.MakeTestResult(); - childResult.SetResult(resultState, message); - _suiteResult.AddResult(childResult); - - if (child.IsSuite) - SkipChildren((TestSuite)child, resultState, message); - - Context.Listener.TestFinished(childResult); - } - } - } - - private void PerformOneTimeTearDown() - { - _teardownCommand.Execute(Context); - } - - private string GetSkipReason() - { - return (string)Test.Properties.Get(PropertyNames.SkipReason); - } - - private string GetProviderStackTrace() - { - return (string)Test.Properties.Get(PropertyNames.ProviderStackTrace); - } - - private void CountDownChildTest() - { - _childTestCountdown.Signal(); - if (_childTestCountdown.CurrentCount == 0) - { - if (Context.ExecutionStatus != TestExecutionStatus.AbortRequested) - PerformOneTimeTearDown(); - - foreach (var childResult in _suiteResult.Children) - if (childResult.ResultState == ResultState.Cancelled) - { - this.Result.SetResult(ResultState.Cancelled, "Cancelled by user"); - break; - } - - WorkItemComplete(); - } - } - - public override void Cancel(bool force) - { - if (Children == null) - return; - - foreach (var child in Children) - { - var ctx = child.Context; - if (ctx != null) - ctx.ExecutionStatus = force ? TestExecutionStatus.AbortRequested : TestExecutionStatus.StopRequested; - - if (child.State == WorkItemState.Running) - child.Cancel(force); - } - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CompositeWorkItem.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CompositeWorkItem.cs.meta deleted file mode 100644 index 148e65b..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CompositeWorkItem.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 110d5035a36a6a34580fb65bb40cd78f -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/UnityEngine.TestRunner/NUnitExtensions/Runner/CoroutineTestWorkItem.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CoroutineTestWorkItem.cs deleted file mode 100644 index 2574e77..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CoroutineTestWorkItem.cs +++ /dev/null @@ -1,75 +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.TestTools.Utils; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal class CoroutineTestWorkItem : UnityWorkItem - { - private static MonoBehaviour m_MonoBehaviourCoroutineRunner; - private TestCommand m_Command; - - public static MonoBehaviour monoBehaviourCoroutineRunner - { - get - { - if (m_MonoBehaviourCoroutineRunner == null) - { - throw new NullReferenceException("MonoBehaviour coroutine runner not set"); - } - return m_MonoBehaviourCoroutineRunner; - } - set { m_MonoBehaviourCoroutineRunner = value; } - } - - public CoroutineTestWorkItem(TestMethod test, ITestFilter filter) - : base(test, null) - { - m_Command = m_Command = TestCommandBuilder.BuildTestCommand(test, filter); - } - - protected override IEnumerable PerformWork() - { - if (m_Command is SkipCommand) - { - m_Command.Execute(Context); - Result = Context.CurrentResult; - WorkItemComplete(); - yield break; - } - - if (m_Command is ApplyChangesToContextCommand) - { - var applyChangesToContextCommand = (ApplyChangesToContextCommand)m_Command; - applyChangesToContextCommand.ApplyChanges(Context); - m_Command = applyChangesToContextCommand.GetInnerCommand(); - } - - var enumerableTestMethodCommand = (IEnumerableTestMethodCommand)m_Command; - try - { - var executeEnumerable = enumerableTestMethodCommand.ExecuteEnumerable(Context).GetEnumerator(); - - var coroutineRunner = new CoroutineRunner(monoBehaviourCoroutineRunner, Context); - yield return coroutineRunner.HandleEnumerableTest(executeEnumerable); - - if (coroutineRunner.HasFailedWithTimeout()) - { - Context.CurrentResult.SetResult(ResultState.Failure, string.Format("Test exceeded Timeout value of {0}ms", Context.TestCaseTimeout)); - } - - while (executeEnumerable.MoveNext()) {} - - Result = Context.CurrentResult; - } - finally - { - WorkItemComplete(); - } - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CoroutineTestWorkItem.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CoroutineTestWorkItem.cs.meta deleted file mode 100644 index dabb0f2..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/CoroutineTestWorkItem.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b557515fff172984e8c4400b43f1c631 -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/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs deleted file mode 100644 index 5acf8bc..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections; -using System.Linq; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using NUnit.Framework.Internal.Execution; -using UnityEngine.TestTools; -using SetUpTearDownCommand = NUnit.Framework.Internal.Commands.SetUpTearDownCommand; -using TestActionCommand = NUnit.Framework.Internal.Commands.TestActionCommand; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal class EditModeTestCallbacks - { - public static Action RestoringTestContext { get; set; } - } - - internal class DefaultTestWorkItem : UnityWorkItem - { - private TestCommand _command; - - public DefaultTestWorkItem(TestMethod test, ITestFilter filter) - : base(test, null) - { - _command = TestCommandBuilder.BuildTestCommand(test, filter); - } - - protected override IEnumerable PerformWork() - { - if (m_DontRunRestoringResult && EditModeTestCallbacks.RestoringTestContext != null) - { - EditModeTestCallbacks.RestoringTestContext(); - Result = Context.CurrentResult; - yield break; - } - - try - { - if (_command is SkipCommand || _command is FailCommand) - { - Result = _command.Execute(Context); - yield break; - } - - if (!(_command is IEnumerableTestMethodCommand)) - { - Debug.LogError("Cannot perform work on " + _command.GetType().Name); - yield break; - } - - foreach (var workItemStep in ((IEnumerableTestMethodCommand)_command).ExecuteEnumerable(Context)) - { - 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; - } - finally - { - WorkItemComplete(); - } - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs.meta deleted file mode 100644 index a880ec1..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c7cfda246e604b945b12b7afedb094ce -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/UnityEngine.TestRunner/NUnitExtensions/Runner/FailCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/FailCommand.cs deleted file mode 100644 index 0c31ded..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/FailCommand.cs +++ /dev/null @@ -1,34 +0,0 @@ - -using System.Collections; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal class FailCommand : TestCommand, IEnumerableTestMethodCommand - { - private ResultState m_ResultState; - private string m_Message; - - public FailCommand(Test test, ResultState resultState, string message) - : base(test) - { - m_ResultState = resultState; - m_Message = message; - } - - public override TestResult Execute(ITestExecutionContext context) - { - context.CurrentResult.SetResult(m_ResultState, m_Message); - return context.CurrentResult; - } - - public IEnumerable ExecuteEnumerable(ITestExecutionContext context) - { - context.CurrentResult.SetResult(m_ResultState, m_Message); - yield return null; - } - } - -} \ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/FailCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/FailCommand.cs.meta deleted file mode 100644 index b0f7840..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/FailCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 68e5dc8bfd5d72647a93b7f2e1da831a -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/UnityEngine.TestRunner/NUnitExtensions/Runner/IEnumerableTestMethodCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/IEnumerableTestMethodCommand.cs deleted file mode 100644 index d62979a..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/IEnumerableTestMethodCommand.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal interface IEnumerableTestMethodCommand - { - IEnumerable ExecuteEnumerable(ITestExecutionContext context); - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/IEnumerableTestMethodCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/IEnumerableTestMethodCommand.cs.meta deleted file mode 100644 index 29ed5a5..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/IEnumerableTestMethodCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dbd43d8a3b8122d4e89b055f53382b11 -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/UnityEngine.TestRunner/NUnitExtensions/Runner/PlaymodeWorkItemFactory.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/PlaymodeWorkItemFactory.cs deleted file mode 100644 index bdb55fe..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/PlaymodeWorkItemFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal class PlaymodeWorkItemFactory : WorkItemFactory - { - protected override UnityWorkItem Create(TestMethod method, ITestFilter filter, ITest loadedTest) - { - return new CoroutineTestWorkItem(method, filter); - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/PlaymodeWorkItemFactory.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/PlaymodeWorkItemFactory.cs.meta deleted file mode 100644 index 42a71f6..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/PlaymodeWorkItemFactory.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7ef6801a8b664544aa9f2ab1bc1f8b60 -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/UnityEngine.TestRunner/NUnitExtensions/Runner/RestoreTestContextAfterDomainReload.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/RestoreTestContextAfterDomainReload.cs deleted file mode 100644 index 4171ed8..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/RestoreTestContextAfterDomainReload.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal class RestoreTestContextAfterDomainReload {} -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/RestoreTestContextAfterDomainReload.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/RestoreTestContextAfterDomainReload.cs.meta deleted file mode 100644 index eaf8bc2..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/RestoreTestContextAfterDomainReload.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 26721f9940339264fb14bdbfe1290e21 -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/UnityEngine.TestRunner/NUnitExtensions/Runner/TestCommandBuilder.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/TestCommandBuilder.cs deleted file mode 100644 index 7cf2103..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/TestCommandBuilder.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections; -using System.Linq; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestTools; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal static class TestCommandBuilder - { - public static TestCommand BuildTestCommand(TestMethod test, ITestFilter filter) - { - if (test.RunState != RunState.Runnable && - !(test.RunState == RunState.Explicit && filter.IsExplicitMatch(test))) - { - return new SkipCommand(test); - } - - var testReturnsIEnumerator = test.Method.ReturnType.Type == typeof(IEnumerator); - - TestCommand command; - if (!testReturnsIEnumerator) - { - command = new TestMethodCommand(test); - } - else - { - command = new EnumerableTestMethodCommand(test); - } - - command = new UnityLogCheckDelegatingCommand(command); - foreach (var wrapper in test.Method.GetCustomAttributes(true)) - { - command = wrapper.Wrap(command); - if (command == null) - { - var message = String.Format("IWrapTestMethod implementation '{0}' returned null as command.", - wrapper.GetType().FullName); - return new FailCommand(test, ResultState.Failure, message); - } - - if (testReturnsIEnumerator && !(command is IEnumerableTestMethodCommand)) - { - command = TryReplaceWithEnumerableCommand(command); - if (command != null) - { - continue; - } - - var message = String.Format("'{0}' is not supported on {1} as it does not handle returning IEnumerator.", - wrapper.GetType().FullName, - GetTestBuilderName(test)); - return new FailCommand(test, ResultState.Failure, message); - } - } - - command = new UnityEngine.TestTools.TestActionCommand(command); - command = new UnityEngine.TestTools.SetUpTearDownCommand(command); - - if (!testReturnsIEnumerator) - { - command = new ImmediateEnumerableCommand(command); - } - - foreach (var wrapper in test.Method.GetCustomAttributes(true)) - { - command = wrapper.Wrap(command); - if (command == null) - { - var message = String.Format("IWrapSetUpTearDown implementation '{0}' returned null as command.", - wrapper.GetType().FullName); - return new FailCommand(test, ResultState.Failure, message); - } - - if (testReturnsIEnumerator && !(command is IEnumerableTestMethodCommand)) - { - command = TryReplaceWithEnumerableCommand(command); - if (command != null) - { - continue; - } - - var message = String.Format("'{0}' is not supported on {1} as it does not handle returning IEnumerator.", - wrapper.GetType().FullName, - GetTestBuilderName(test)); - return new FailCommand(test, ResultState.Failure, message); - } - } - - command = new EnumerableSetUpTearDownCommand(command); - command = new OuterUnityTestActionCommand(command); - - IApplyToContext[] changes = test.Method.GetCustomAttributes(true); - if (changes.Length > 0) - { - command = new EnumerableApplyChangesToContextCommand(command, changes); - } - - return command; - } - - private static string GetTestBuilderName(TestMethod testMethod) - { - return new[] - { - testMethod.Method.GetCustomAttributes(true).Select(attribute => attribute.GetType().Name), - testMethod.Method.GetCustomAttributes(true).Select(attribute => attribute.GetType().Name) - }.SelectMany(v => v).FirstOrDefault(); - } - - private static TestCommand TryReplaceWithEnumerableCommand(TestCommand command) - { - switch (command.GetType().Name) - { - case nameof(RepeatAttribute.RepeatedTestCommand): - return new EnumerableRepeatedTestCommand(command as RepeatAttribute.RepeatedTestCommand); - case nameof(RetryAttribute.RetryCommand): - return new EnumerableRetryTestCommand(command as RetryAttribute.RetryCommand); - default: - return null; - } - } - } -} \ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/TestCommandBuilder.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/TestCommandBuilder.cs.meta deleted file mode 100644 index 2c4a37b..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/TestCommandBuilder.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f40df9c8cf926b241b093a37028d8815 -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/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityLogCheckDelegatingCommand.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityLogCheckDelegatingCommand.cs deleted file mode 100644 index 1081e06..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityLogCheckDelegatingCommand.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Commands; -using UnityEngine.TestTools; -using UnityEngine.TestTools.Logging; -using UnityEngine.TestTools.TestRunner; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - class UnityLogCheckDelegatingCommand : DelegatingTestCommand, IEnumerableTestMethodCommand - { - static Dictionary s_AttributeCache = new Dictionary(); - - public UnityLogCheckDelegatingCommand(TestCommand innerCommand) - : base(innerCommand) {} - - public override TestResult Execute(ITestExecutionContext context) - { - using (var logScope = new LogScope()) - { - if (ExecuteAndCheckLog(logScope, context.CurrentResult, () => innerCommand.Execute(context))) - PostTestValidation(logScope, innerCommand, context.CurrentResult); - } - - return context.CurrentResult; - } - - public IEnumerable ExecuteEnumerable(ITestExecutionContext context) - { - if (!(innerCommand is IEnumerableTestMethodCommand enumerableTestMethodCommand)) - { - Execute(context); - yield break; - } - - using (var logScope = new LogScope()) - { - IEnumerable executeEnumerable = null; - - if (!ExecuteAndCheckLog(logScope, context.CurrentResult, - () => executeEnumerable = enumerableTestMethodCommand.ExecuteEnumerable(context))) - yield break; - - foreach (var step in executeEnumerable) - { - // do not check expected logs here - we want to permit expecting and receiving messages to run - // across frames. (but we do always want to catch a fail immediately.) - if (!CheckFailingLogs(logScope, context.CurrentResult)) - yield break; - - yield return step; - } - - if (!CheckLogs(context.CurrentResult, logScope)) - yield break; - - PostTestValidation(logScope, innerCommand, context.CurrentResult); - } - } - - static bool CaptureException(TestResult result, Action action) - { - try - { - action(); - return true; - } - catch (Exception e) - { - result.RecordException(e); - return false; - } - } - - static bool ExecuteAndCheckLog(LogScope logScope, TestResult result, Action action) - => CaptureException(result, action) && CheckLogs(result, logScope); - - static void PostTestValidation(LogScope logScope, TestCommand command, TestResult result) - { - if (MustExpect(command.Test.Method.MethodInfo)) - CaptureException(result, logScope.NoUnexpectedReceived); - } - - static bool CheckLogs(TestResult result, LogScope logScope) - => CheckFailingLogs(logScope, result) && CheckExpectedLogs(logScope, result); - - static bool CheckFailingLogs(LogScope logScope, TestResult result) - { - if (!logScope.AnyFailingLogs()) - return true; - - var failingLog = logScope.FailingLogs.First(); - result.RecordException(new UnhandledLogMessageException(failingLog)); - return false; - } - - static bool CheckExpectedLogs(LogScope logScope, TestResult result) - { - if (!logScope.ExpectedLogs.Any()) - return true; - - var expectedLog = logScope.ExpectedLogs.Peek(); - result.RecordException(new UnexpectedLogMessageException(expectedLog)); - return false; - } - - static bool MustExpect(MemberInfo method) - { - // method - - var methodAttr = method.GetCustomAttributes(true).FirstOrDefault(); - if (methodAttr != null) - return methodAttr.MustExpect; - - // fixture - - var fixture = method.DeclaringType; - if (!s_AttributeCache.TryGetValue(fixture, out var mustExpect)) - { - var fixtureAttr = fixture.GetCustomAttributes(true).FirstOrDefault(); - mustExpect = s_AttributeCache[fixture] = fixtureAttr?.MustExpect; - } - - if (mustExpect != null) - return mustExpect.Value; - - // assembly - - var assembly = fixture.Assembly; - if (!s_AttributeCache.TryGetValue(assembly, out mustExpect)) - { - var assemblyAttr = assembly.GetCustomAttributes().FirstOrDefault(); - mustExpect = s_AttributeCache[assembly] = assemblyAttr?.MustExpect; - } - - return mustExpect == true; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityLogCheckDelegatingCommand.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityLogCheckDelegatingCommand.cs.meta deleted file mode 100644 index 42b3b73..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityLogCheckDelegatingCommand.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 48230e4e90fb4d14a9d56bddea898413 -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/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestAssemblyRunner.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestAssemblyRunner.cs deleted file mode 100644 index dbb60c8..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestAssemblyRunner.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using NUnit; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using UnityEngine.TestTools; -using UnityEngine.TestTools.NUnitExtensions; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal interface IUnityTestAssemblyRunner - { - ITest LoadedTest { get; } - ITestResult Result { get; } - bool IsTestLoaded { get; } - bool IsTestRunning { get; } - bool IsTestComplete { get; } - UnityWorkItem TopLevelWorkItem { get; set; } - UnityTestExecutionContext GetCurrentContext(); - ITest Load(Assembly[] assemblies, TestPlatform testPlatform, IDictionary settings); - IEnumerable Run(ITestListener listener, ITestFilter filter); - void StopRun(); - } - - internal class UnityTestAssemblyRunner : IUnityTestAssemblyRunner - { - private readonly UnityTestAssemblyBuilder unityBuilder; - private readonly WorkItemFactory m_Factory; - - protected UnityTestExecutionContext Context { get; set; } - - public UnityTestExecutionContext GetCurrentContext() - { - return UnityTestExecutionContext.CurrentContext; - } - - protected IDictionary Settings { get; set; } - public ITest LoadedTest { get; protected set; } - - public ITestResult Result - { - get { return TopLevelWorkItem == null ? null : TopLevelWorkItem.Result; } - } - - public bool IsTestLoaded - { - get { return LoadedTest != null; } - } - - public bool IsTestRunning - { - get { return TopLevelWorkItem != null && TopLevelWorkItem.State == NUnit.Framework.Internal.Execution.WorkItemState.Running; } - } - public bool IsTestComplete - { - get { return TopLevelWorkItem != null && TopLevelWorkItem.State == NUnit.Framework.Internal.Execution.WorkItemState.Complete; } - } - - public UnityTestAssemblyRunner(UnityTestAssemblyBuilder builder, WorkItemFactory factory) - { - unityBuilder = builder; - m_Factory = factory; - Context = new UnityTestExecutionContext(); - } - - public ITest Load(Assembly[] assemblies, TestPlatform testPlatform, IDictionary settings) - { - Settings = settings; - - if (settings.ContainsKey(FrameworkPackageSettings.RandomSeed)) - Randomizer.InitialSeed = (int)settings[FrameworkPackageSettings.RandomSeed]; - - return LoadedTest = unityBuilder.Build(assemblies, Enumerable.Repeat(testPlatform, assemblies.Length).ToArray(), settings); - } - - public IEnumerable Run(ITestListener listener, ITestFilter filter) - { - TopLevelWorkItem = m_Factory.Create(LoadedTest, filter); - TopLevelWorkItem.InitializeContext(Context); - UnityTestExecutionContext.CurrentContext = Context; - Context.Listener = listener; - - return TopLevelWorkItem.Execute(); - } - - public UnityWorkItem TopLevelWorkItem { get; set; } - - public void StopRun() - { - if (IsTestRunning) - { - TopLevelWorkItem.Cancel(false); - } - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestAssemblyRunner.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestAssemblyRunner.cs.meta deleted file mode 100644 index 2277fc0..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestAssemblyRunner.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 874e40a588dbb1e48bc128d686337d4e -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/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestExecutionContext.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestExecutionContext.cs deleted file mode 100644 index ca17b70..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestExecutionContext.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using NUnit.Framework; -using NUnit.Framework.Constraints; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Execution; -using UnityEngine.TestTools; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal class UnityTestExecutionContext : ITestExecutionContext - { - private readonly UnityTestExecutionContext _priorContext; - private TestResult _currentResult; - private int _assertCount; - - public static UnityTestExecutionContext CurrentContext { get; set; } - - public UnityTestExecutionContext Context { get; private set; } - - public Test CurrentTest { get; set; } - public DateTime StartTime { get; set; } - public long StartTicks { get; set; } - public TestResult CurrentResult - { - get { return _currentResult; } - set - { - _currentResult = value; - if (value != null) - OutWriter = value.OutWriter; - } - } - - public object TestObject { get; set; } - public string WorkDirectory { get; set; } - - - private TestExecutionStatus _executionStatus; - public TestExecutionStatus ExecutionStatus - { - get - { - // ExecutionStatus may have been set to StopRequested or AbortRequested - // in a prior context. If so, reflect the same setting in this context. - if (_executionStatus == TestExecutionStatus.Running && _priorContext != null) - _executionStatus = _priorContext.ExecutionStatus; - - return _executionStatus; - } - set - { - _executionStatus = value; - - // Push the same setting up to all prior contexts - if (_priorContext != null) - _priorContext.ExecutionStatus = value; - } - } - - public List UpstreamActions { get; private set; } - public int TestCaseTimeout { get; set; } - public CultureInfo CurrentCulture { get; set; } - public CultureInfo CurrentUICulture { get; set; } - public ITestListener Listener { get; set; } - - public UnityTestExecutionContext() - { - UpstreamActions = new List(); - CurrentContext = this; - } - - public UnityTestExecutionContext(UnityTestExecutionContext other) - { - _priorContext = other; - - CurrentTest = other.CurrentTest; - CurrentResult = other.CurrentResult; - TestObject = other.TestObject; - WorkDirectory = other.WorkDirectory; - Listener = other.Listener; - TestCaseTimeout = other.TestCaseTimeout; - UpstreamActions = new List(other.UpstreamActions); - SetUpTearDownState = other.SetUpTearDownState; - OuterUnityTestActionState = other.OuterUnityTestActionState; - - TestContext.CurrentTestExecutionContext = this; - - CurrentCulture = other.CurrentCulture; - CurrentUICulture = other.CurrentUICulture; - CurrentContext = this; - } - - public TextWriter OutWriter { get; private set; } - public bool StopOnError { get; set; } - - public IWorkItemDispatcher Dispatcher { get; set; } - - public ParallelScope ParallelScope { get; set; } - public string WorkerId { get; private set; } - public Randomizer RandomGenerator { get; private set; } - public ValueFormatter CurrentValueFormatter { get; private set; } - public bool IsSingleThreaded { get; set; } - public BeforeAfterTestCommandState SetUpTearDownState { get; set; } - public BeforeAfterTestCommandState OuterUnityTestActionState { get; set; } - public int EnumerableRepeatedTestState { get; set; } - public int EnumerableRetryTestState { get; set; } - - internal int AssertCount - { - get - { - return _assertCount; - } - } - - public void IncrementAssertCount() - { - _assertCount += 1; - } - - public void AddFormatter(ValueFormatterFactory formatterFactory) - { - throw new NotImplementedException(); - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestExecutionContext.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestExecutionContext.cs.meta deleted file mode 100644 index f218a3d..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityTestExecutionContext.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 59ff995fabb3bac45afa0f96f333e5dc -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/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItem.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItem.cs deleted file mode 100644 index a4593db..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItem.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using NUnit.Framework.Internal.Execution; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal abstract class UnityWorkItem - { - protected readonly WorkItemFactory m_Factory; - protected bool m_ExecuteTestStartEvent; - protected bool m_DontRunRestoringResult; - public event EventHandler Completed; - - public bool ResultedInDomainReload { get; internal set; } - - public UnityTestExecutionContext Context { get; private set; } - - public Test Test { get; private set; } - - public TestResult Result { get; protected set; } - - public WorkItemState State { get; private set; } - - public List Actions { get; private set; } - - protected UnityWorkItem(Test test, WorkItemFactory factory) - { - m_Factory = factory; - Test = test; - Actions = new List(); - Result = test.MakeTestResult(); - State = WorkItemState.Ready; - m_ExecuteTestStartEvent = ShouldExecuteStartEvent(); - m_DontRunRestoringResult = ShouldRestore(test); - } - - protected static bool ShouldRestore(ITest loadedTest) - { - return UnityWorkItemDataHolder.alreadyExecutedTests != null && UnityWorkItemDataHolder.alreadyExecutedTests.Contains(loadedTest.FullName); - } - - protected bool ShouldExecuteStartEvent() - { - return UnityWorkItemDataHolder.alreadyStartedTests != null && UnityWorkItemDataHolder.alreadyStartedTests.All(x => x != Test.FullName) && !ShouldRestore(Test); - } - - protected abstract IEnumerable PerformWork(); - - public void InitializeContext(UnityTestExecutionContext context) - { - Context = context; - - if (Test is TestAssembly) - Actions.AddRange(ActionsHelper.GetActionsFromTestAssembly((TestAssembly)Test)); - else if (Test is ParameterizedMethodSuite) - Actions.AddRange(ActionsHelper.GetActionsFromTestMethodInfo(Test.Method)); - else if (Test.TypeInfo != null) - Actions.AddRange(ActionsHelper.GetActionsFromTypesAttributes(Test.TypeInfo.Type)); - } - - public virtual IEnumerable Execute() - { - Context.CurrentTest = this.Test; - Context.CurrentResult = this.Result; - - if (m_ExecuteTestStartEvent) - { - Context.Listener.TestStarted(Test); - } - - Context.StartTime = DateTime.UtcNow; - Context.StartTicks = Stopwatch.GetTimestamp(); - - State = WorkItemState.Running; - - return PerformWork(); - } - - protected void WorkItemComplete() - { - State = WorkItemState.Complete; - - Result.StartTime = Context.StartTime; - Result.EndTime = DateTime.UtcNow; - - long tickCount = Stopwatch.GetTimestamp() - Context.StartTicks; - double seconds = (double)tickCount / Stopwatch.Frequency; - Result.Duration = seconds; - - //Result.AssertCount += Context.AssertCount; - - Context.Listener.TestFinished(Result); - - if (Completed != null) - Completed(this, EventArgs.Empty); - - Context.TestObject = null; - Test.Fixture = null; - } - - public virtual void Cancel(bool force) - { - Result.SetResult(ResultState.Cancelled, "Cancelled by user"); - Context.Listener.TestFinished(Result); - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItem.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItem.cs.meta deleted file mode 100644 index e0b4496..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItem.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 79ced2556f0af814a840b86232613ff1 -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/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItemDataHolder.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItemDataHolder.cs deleted file mode 100644 index dc9a3d1..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItemDataHolder.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal class UnityWorkItemDataHolder - { - public static List alreadyStartedTests = new List(); - public static List alreadyExecutedTests; - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItemDataHolder.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItemDataHolder.cs.meta deleted file mode 100644 index 77b31f2..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/UnityWorkItemDataHolder.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5b3e90046c38f1d4dad2e0d5a79e871c -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/UnityEngine.TestRunner/NUnitExtensions/Runner/WorkItemFactory.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/WorkItemFactory.cs deleted file mode 100644 index 89683ac..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/WorkItemFactory.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Collections; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestRunner.NUnitExtensions.Runner -{ - internal abstract class WorkItemFactory - { - public UnityWorkItem Create(ITest loadedTest, ITestFilter filter) - { - TestSuite suite = loadedTest as TestSuite; - if (suite != null) - { - return new CompositeWorkItem(suite, filter, this); - } - - var testMethod = (TestMethod)loadedTest; - if (testMethod.Method.ReturnType.Type != typeof(IEnumerator)) - { - return new DefaultTestWorkItem(testMethod, filter); - } - - return Create(testMethod, filter, loadedTest); - } - - protected abstract UnityWorkItem Create(TestMethod method, ITestFilter filter, ITest loadedTest); - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/WorkItemFactory.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/WorkItemFactory.cs.meta deleted file mode 100644 index e22ce95..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/WorkItemFactory.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5c15bf0966eb95847a4260d830a30d30 -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/UnityEngine.TestRunner/NUnitExtensions/TestExtensions.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestExtensions.cs deleted file mode 100644 index a326004..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestExtensions.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; -using UnityEngine.TestRunner.NUnitExtensions.Filters; - -namespace UnityEngine.TestRunner.NUnitExtensions -{ - internal static class TestExtensions - { - private static IEnumerable GetTestCategories(this ITest test) - { - var categories = test.Properties[PropertyNames.Category].Cast().ToList(); - if (categories.Count == 0 && test is TestMethod) - { - // only mark tests as Uncategorized if the test fixture doesn't have a category, - // otherwise the test inherits the Fixture category - var fixtureCategories = test.Parent.Properties[PropertyNames.Category].Cast().ToList(); - if (fixtureCategories.Count == 0) - categories.Add(CategoryFilterExtended.k_DefaultCategory); - } - return categories; - } - - public static bool HasCategory(this ITest test, string[] categoryFilter) - { - var categories = test.GetAllCategoriesFromTest().Distinct(); - return categoryFilter.Any(c => categories.Any(r => r == c)); - } - - public static List GetAllCategoriesFromTest(this ITest test) - { - if (test.Parent == null) - return test.GetTestCategories().ToList(); - - var categories = GetAllCategoriesFromTest(test.Parent); - categories.AddRange(test.GetTestCategories()); - return categories; - } - - public static void ParseForNameDuplicates(this ITest test) - { - var duplicates = new Dictionary(); - for (var i = 0; i < test.Tests.Count; i++) - { - var child = test.Tests[i]; - int count; - if (duplicates.TryGetValue(child.FullName, out count)) - { - count++; - child.Properties.Add("childIndex", count); - duplicates[child.FullName] = count; - } - else - { - duplicates.Add(child.FullName, 1); - } - ParseForNameDuplicates(child); - } - } - - public static int GetChildIndex(this ITest test) - { - var index = test.Properties["childIndex"]; - return (int)index[0]; - } - - public static bool HasChildIndex(this ITest test) - { - var index = test.Properties["childIndex"]; - return index.Count > 0; - } - - static string GetAncestorPath(ITest test) - { - var path = ""; - var testParent = test.Parent; - - while (testParent != null && testParent.Parent != null && !string.IsNullOrEmpty(testParent.Name)) - { - path = testParent.Name + "/" + path; - testParent = testParent.Parent; - } - - return path; - } - - public static string GetUniqueName(this ITest test) - { - var id = GetAncestorPath(test) + GetFullName(test); - if (test.HasChildIndex()) - { - var index = test.GetChildIndex(); - if (index >= 0) - id += index; - } - if (test.IsSuite) - { - id += "[suite]"; - } - return id; - } - - public static string GetFullName(ITest test) - { - if (test.TypeInfo == null && (test.Parent == null || test.Parent.TypeInfo == null)) - { - return "[" + test.FullName + "]"; - } - var assemblyId = test.TypeInfo == null ? test.Parent.TypeInfo.Assembly.GetName().Name : test.TypeInfo.Assembly.GetName().Name; - return string.Format("[{0}][{1}]", assemblyId, test.FullName); - } - - public static string GetSkipReason(this ITest test) - { - if (test.Properties.ContainsKey(PropertyNames.SkipReason)) - return (string)test.Properties.Get(PropertyNames.SkipReason); - - return null; - } - - public static string GetParentId(this ITest test) - { - if (test.Parent != null) - return test.Parent.Id; - - return null; - } - - public static string GetParentFullName(this ITest test) - { - if (test.Parent != null) - return test.Parent.FullName; - - return null; - } - - public static string GetParentUniqueName(this ITest test) - { - if (test.Parent != null) - return GetUniqueName(test.Parent); - - return null; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestExtensions.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestExtensions.cs.meta deleted file mode 100644 index d7e04b4..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8bc74398aa3944646ade4ee78cd57484 -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/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs deleted file mode 100644 index 0c14397..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using NUnit.Framework; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestRunner.NUnitExtensions -{ - internal static class TestResultExtensions - { - public static void RecordPrefixedException(this TestResult testResult, string prefix, Exception ex, ResultState resultState = null) - - { - if (ex is NUnitException) - { - ex = ex.InnerException; - } - - if (resultState == null) - { - resultState = testResult.ResultState == ResultState.Cancelled - ? ResultState.Cancelled - : ResultState.Error; - } - - var exceptionMessage = ExceptionHelper.BuildMessage(ex); - string stackTrace = "--" + prefix + NUnit.Env.NewLine + ExceptionHelper.BuildStackTrace(ex); - if (testResult.StackTrace != null) - { - stackTrace = testResult.StackTrace + NUnit.Env.NewLine + stackTrace; - } - - if (testResult.Test.IsSuite) - { - resultState = resultState.WithSite(FailureSite.TearDown); - } - - if (ex is ResultStateException) - { - exceptionMessage = ex.Message; - resultState = ((ResultStateException)ex).ResultState; - stackTrace = StackFilter.Filter(ex.StackTrace); - } - - string message = (string.IsNullOrEmpty(prefix) ? "" : (prefix + " : ")) + exceptionMessage; - if (testResult.Message != null) - { - message = testResult.Message + NUnit.Env.NewLine + message; - } - - testResult.SetResult(resultState, message, stackTrace); - } - - public static void RecordPrefixedError(this TestResult testResult, string prefix, string error, ResultState resultState = null) - - { - if (resultState == null) - { - resultState = testResult.ResultState == ResultState.Cancelled - ? ResultState.Cancelled - : ResultState.Error; - } - - if (testResult.Test.IsSuite) - { - resultState = resultState.WithSite(FailureSite.TearDown); - } - - string message = (string.IsNullOrEmpty(prefix) ? "" : (prefix + " : ")) + error; - if (testResult.Message != null) - { - message = testResult.Message + NUnit.Env.NewLine + message; - } - - testResult.SetResult(resultState, message); - } - } -} \ No newline at end of file diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs.meta deleted file mode 100644 index 86eb9ad..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/TestResultExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 65fb6da362a78334ab360a125cfafdaf -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/UnityEngine.TestRunner/NUnitExtensions/UnityTestAssemblyBuilder.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/UnityTestAssemblyBuilder.cs deleted file mode 100644 index 3a130c5..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/UnityTestAssemblyBuilder.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using NUnit; -using NUnit.Framework.Api; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestTools.NUnitExtensions -{ - internal class UnityTestAssemblyBuilder : DefaultTestAssemblyBuilder, IAsyncTestAssemblyBuilder - { - private readonly string m_ProductName; - public UnityTestAssemblyBuilder() - { - m_ProductName = Application.productName; - } - - public ITest Build(Assembly[] assemblies, TestPlatform[] testPlatforms, IDictionary options) - { - var test = BuildAsync(assemblies, testPlatforms, options); - while (test.MoveNext()) - { - } - - return test.Current; - } - - public IEnumerator BuildAsync(Assembly[] assemblies, TestPlatform[] testPlatforms, IDictionary options) - { - var productName = string.Join("_", m_ProductName.Split(Path.GetInvalidFileNameChars())); - var suite = new TestSuite(productName); - for (var index = 0; index < assemblies.Length; index++) - { - var assembly = assemblies[index]; - var platform = testPlatforms[index]; - - var assemblySuite = Build(assembly, options) as TestSuite; - if (assemblySuite != null && assemblySuite.HasChildren) - { - assemblySuite.Properties.Set("platform", platform); - suite.Add(assemblySuite); - } - - yield return null; - } - - yield return suite; - } - - public static Dictionary GetNUnitTestBuilderSettings(TestPlatform testPlatform) - { - var emptySettings = new Dictionary(); - emptySettings.Add(FrameworkPackageSettings.TestParameters, "platform=" + testPlatform); - return emptySettings; - } - } -} diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/UnityTestAssemblyBuilder.cs.meta b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/UnityTestAssemblyBuilder.cs.meta deleted file mode 100644 index abd0444..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/UnityTestAssemblyBuilder.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 98ba0396e4b4ee8498a8f097affcfddf -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: -- cgit v1.2.3