diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-20 19:09:33 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-20 19:09:33 -0400 |
| commit | 7c1e566113d59699af1624186c64eca67f063fc6 (patch) | |
| tree | 5a6850a695986872d5d0b09d7dab8421628fe33e /Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs | |
| parent | dd117b77aae1d8be7563b360d05b842a73b7dab2 (diff) | |
| download | Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.tar.gz Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.tar.bz2 Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.zip | |
Upgraded Unity
Diffstat (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs')
| -rw-r--r-- | Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/NUnitExtensions/Runner/DefaultTestWorkItem.cs | 96 |
1 files changed, 0 insertions, 96 deletions
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();
- }
- }
- }
-}
|
