From 7c1e566113d59699af1624186c64eca67f063fc6 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 20 Apr 2020 19:09:33 -0400 Subject: Upgraded Unity --- .../TestRunner/Callbacks/TestResultRenderer.cs | 97 ---------------------- 1 file changed, 97 deletions(-) delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/TestRunner/Callbacks/TestResultRenderer.cs (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/TestRunner/Callbacks/TestResultRenderer.cs') diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/TestRunner/Callbacks/TestResultRenderer.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/TestRunner/Callbacks/TestResultRenderer.cs deleted file mode 100644 index 95316e7..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEngine.TestRunner/TestRunner/Callbacks/TestResultRenderer.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework.Interfaces; -using NUnit.Framework.Internal; - -namespace UnityEngine.TestTools.TestRunner.Callbacks -{ - internal class TestResultRenderer - { - private static class Styles - { - public static readonly GUIStyle SucceedLabelStyle; - public static readonly GUIStyle FailedLabelStyle; - public static readonly GUIStyle FailedMessagesStyle; - - static Styles() - { - SucceedLabelStyle = new GUIStyle("label"); - SucceedLabelStyle.normal.textColor = Color.green; - SucceedLabelStyle.fontSize = 48; - - FailedLabelStyle = new GUIStyle("label"); - FailedLabelStyle.normal.textColor = Color.red; - FailedLabelStyle.fontSize = 32; - - FailedMessagesStyle = new GUIStyle("label"); - FailedMessagesStyle.wordWrap = false; - FailedMessagesStyle.richText = true; - } - } - - private readonly List m_FailedTestCollection; - - private bool m_ShowResults; - private Vector2 m_ScrollPosition; - - public TestResultRenderer(ITestResult testResults) - { - m_FailedTestCollection = new List(); - GetFailedTests(testResults); - } - - private void GetFailedTests(ITestResult testResults) - { - if (testResults is TestCaseResult) - { - if (testResults.ResultState.Status == TestStatus.Failed) - m_FailedTestCollection.Add(testResults); - } - else if (testResults.HasChildren) - { - foreach (var testResultsChild in testResults.Children) - { - GetFailedTests(testResultsChild); - } - } - } - - private const int k_MaxStringLength = 15000; - - public void ShowResults() - { - m_ShowResults = true; - Cursor.visible = true; - } - - public void Draw() - { - if (!m_ShowResults) return; - if (m_FailedTestCollection.Count == 0) - { - GUILayout.Label("All test(s) succeeded", Styles.SucceedLabelStyle, GUILayout.Width(600)); - } - else - { - int count = m_FailedTestCollection.Count; - GUILayout.Label(count + " tests failed!", Styles.FailedLabelStyle); - - m_ScrollPosition = GUILayout.BeginScrollView(m_ScrollPosition, GUILayout.ExpandWidth(true)); - var text = ""; - - text += "Code-based tests\n"; - text += string.Join("\n", m_FailedTestCollection - .Select(result => result.Name + " " + result.ResultState + "\n" + result.Message) - .ToArray()); - - if (text.Length > k_MaxStringLength) - text = text.Substring(0, k_MaxStringLength); - - GUILayout.TextArea(text, Styles.FailedMessagesStyle); - GUILayout.EndScrollView(); - } - if (GUILayout.Button("Close")) - Application.Quit(); - } - } -} -- cgit v1.2.3