diff options
Diffstat (limited to 'Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting')
10 files changed, 0 insertions, 261 deletions
diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackData.cs b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackData.cs deleted file mode 100644 index 99232f6..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackData.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System;
-using System.Collections.Generic;
-using JetBrains.Annotations;
-using UnityEditor;
-
-namespace Packages.Rider.Editor.UnitTesting
-{
- public class CallbackData : ScriptableSingleton<CallbackData>
- {
- public bool isRider;
-
- [UsedImplicitly] public static event EventHandler Changed = (sender, args) => { };
-
- internal void RaiseChangedEvent()
- {
- Changed(null, EventArgs.Empty);
- }
-
- public List<TestEvent> events = new List<TestEvent>();
-
- [UsedImplicitly]
- public void Clear()
- {
- events.Clear();
- }
- }
-}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackData.cs.meta b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackData.cs.meta deleted file mode 100644 index c58daeb..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackData.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 010246a07de7cb34185a2a7b1c1fad59
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackInitializer.cs b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackInitializer.cs deleted file mode 100644 index f9dc5b9..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackInitializer.cs +++ /dev/null @@ -1,18 +0,0 @@ -#if TEST_FRAMEWORK
-using UnityEditor;
-using UnityEditor.TestTools.TestRunner.Api;
-using UnityEngine;
-
-namespace Packages.Rider.Editor.UnitTesting
-{
- [InitializeOnLoad]
- internal static class CallbackInitializer
- {
- static CallbackInitializer()
- {
- if (CallbackData.instance.isRider)
- ScriptableObject.CreateInstance<TestRunnerApi>().RegisterCallbacks(ScriptableObject.CreateInstance<TestsCallback>(), 0);
- }
- }
-}
-#endif
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackInitializer.cs.meta b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackInitializer.cs.meta deleted file mode 100644 index 11042d6..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/CallbackInitializer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: aa1c6b1a353ab464782fc1e7c051eb02
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/RiderTestRunner.cs b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/RiderTestRunner.cs deleted file mode 100644 index eb3b249..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/RiderTestRunner.cs +++ /dev/null @@ -1,47 +0,0 @@ -using JetBrains.Annotations;
-using UnityEngine;
-#if TEST_FRAMEWORK
-using UnityEditor;
-using UnityEditor.TestTools.TestRunner.Api;
-#endif
-
-namespace Packages.Rider.Editor.UnitTesting
-{
- public static class RiderTestRunner
- {
-#if TEST_FRAMEWORK
- private static readonly TestsCallback Callback = ScriptableObject.CreateInstance<TestsCallback>();
-#endif
- [UsedImplicitly]
- public static void RunTests(int testMode, string[] assemblyNames, string[] testNames, string[] categoryNames, string[] groupNames, int? buildTarget)
- {
-#if !TEST_FRAMEWORK
- Debug.LogError("Update Test Framework package to v.1.1.1+ to run tests from Rider.");
-#else
- CallbackData.instance.isRider = true;
-
- var api = ScriptableObject.CreateInstance<TestRunnerApi>();
- var settings = new ExecutionSettings();
- var filter = new Filter
- {
- assemblyNames = assemblyNames,
- testNames = testNames,
- categoryNames = categoryNames,
- groupNames = groupNames,
- targetPlatform = (BuildTarget?) buildTarget
- };
-
- if (testMode > 0) // for future use - test-framework would allow running both Edit and Play test at once
- filter.testMode = (TestMode) testMode;
-
- settings.filters = new []{
- filter
- };
- api.Execute(settings);
-
- api.UnregisterCallbacks(Callback); // avoid multiple registrations
- api.RegisterCallbacks(Callback); // This can be used to receive information about when the test suite and individual tests starts and stops. Provide this with a scriptable object implementing ICallbacks
-#endif
- }
- }
-}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/RiderTestRunner.cs.meta b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/RiderTestRunner.cs.meta deleted file mode 100644 index 8ec5502..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/RiderTestRunner.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 5c3b27069cb3ddf42ba1260eeefcdd1c
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestEvent.cs b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestEvent.cs deleted file mode 100644 index 9e3fff2..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestEvent.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System;
-using NUnit.Framework.Interfaces;
-
-namespace Packages.Rider.Editor.UnitTesting
-{
- [Serializable]
- public enum EventType { TestStarted, TestFinished, RunFinished }
-
- [Serializable]
- public class TestEvent
- {
- public EventType type;
- public string id;
- public string assemblyName;
- public string output;
- public TestStatus testStatus;
- public double duration;
- public string parentId;
-
- public TestEvent(EventType type, string id, string assemblyName, string output, double duration, TestStatus testStatus, string parentID)
- {
- this.type = type;
- this.id = id;
- this.assemblyName = assemblyName;
- this.output = output;
- this.testStatus = testStatus;
- this.duration = duration;
- parentId = parentID;
- }
- }
-}
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestEvent.cs.meta b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestEvent.cs.meta deleted file mode 100644 index a6afa14..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestEvent.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: f9413c47b3a14a64e8810ce76d1a6032
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestsCallback.cs b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestsCallback.cs deleted file mode 100644 index b6a5637..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestsCallback.cs +++ /dev/null @@ -1,83 +0,0 @@ -#if TEST_FRAMEWORK
-using System;
-using System.Text;
-using UnityEditor.TestTools.TestRunner.Api;
-using UnityEngine;
-
-namespace Packages.Rider.Editor.UnitTesting
-{
- public class TestsCallback : ScriptableObject, ICallbacks
- {
- public void RunFinished(ITestResultAdaptor result)
- {
- CallbackData.instance.isRider = false;
-
- CallbackData.instance.events.Add(
- new TestEvent(EventType.RunFinished, "", "","", 0, ParseTestStatus(result.TestStatus), ""));
- CallbackData.instance.RaiseChangedEvent();
- }
-
- public void TestStarted(ITestAdaptor result)
- {
- if (result.Method == null) return;
-
- CallbackData.instance.events.Add(
- new TestEvent(EventType.TestStarted, GetUniqueName(result), result.Method.TypeInfo.Assembly.GetName().Name, "", 0, ParseTestStatus(TestStatus.Passed), result.ParentFullName));
- CallbackData.instance.RaiseChangedEvent();
- }
-
- public void TestFinished(ITestResultAdaptor result)
- {
- if (result.Test.Method == null) return;
-
- CallbackData.instance.events.Add(
- new TestEvent(EventType.TestFinished, GetUniqueName(result.Test), result.Test.Method.TypeInfo.Assembly.GetName().Name, ExtractOutput(result), result.Duration, ParseTestStatus(result.TestStatus), result.Test.ParentFullName));
- CallbackData.instance.RaiseChangedEvent();
- }
-
- // todo: reimplement JetBrains.Rider.Unity.Editor.AfterUnity56.UnitTesting.TestEventsSender.GetUniqueName
- private static string GetUniqueName(ITestAdaptor test)
- {
- string str = test.FullName;
- return str;
- }
-
- public void RunStarted(ITestAdaptor testsToRun)
- {
- }
-
- private static NUnit.Framework.Interfaces.TestStatus ParseTestStatus(TestStatus testStatus)
- {
- return (NUnit.Framework.Interfaces.TestStatus)Enum.Parse(typeof(NUnit.Framework.Interfaces.TestStatus), testStatus.ToString());
- }
-
- private static string ExtractOutput(ITestResultAdaptor testResult)
- {
- var stringBuilder = new StringBuilder();
- if (testResult.Message != null)
- {
- stringBuilder.AppendLine("Message: ");
- stringBuilder.AppendLine(testResult.Message);
- }
-
- if (!string.IsNullOrEmpty(testResult.Output))
- {
- stringBuilder.AppendLine("Output: ");
- stringBuilder.AppendLine(testResult.Output);
- }
-
- if (!string.IsNullOrEmpty(testResult.StackTrace))
- {
- stringBuilder.AppendLine("Stacktrace: ");
- stringBuilder.AppendLine(testResult.StackTrace);
- }
-
- var result = stringBuilder.ToString();
- if (result.Length > 0)
- return result;
-
- return testResult.Output ?? string.Empty;
- }
- }
-}
-#endif
\ No newline at end of file diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestsCallback.cs.meta b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestsCallback.cs.meta deleted file mode 100644 index 345e1ce..0000000 --- a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/UnitTesting/TestsCallback.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2
-guid: 58aa570dbe0761f43b25ff6c2265bbe2
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
|
