summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/UnityTestProtocol/UtpMessageReporter.cs
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-04-19 17:19:32 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-04-19 17:19:32 -0400
commitc55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 (patch)
treeee4d51c7c1d633e11f46453ef1edd3c77c4ef9f7 /Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/UnityTestProtocol/UtpMessageReporter.cs
downloadProject-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.gz
Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.bz2
Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.zip
Inital commit
Diffstat (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/UnityTestProtocol/UtpMessageReporter.cs')
-rw-r--r--Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/UnityTestProtocol/UtpMessageReporter.cs57
1 files changed, 57 insertions, 0 deletions
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/UnityTestProtocol/UtpMessageReporter.cs b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/UnityTestProtocol/UtpMessageReporter.cs
new file mode 100644
index 0000000..22450c8
--- /dev/null
+++ b/Library/PackageCache/com.unity.test-framework@1.1.11/UnityEditor.TestRunner/UnityTestProtocol/UtpMessageReporter.cs
@@ -0,0 +1,57 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEditor.Compilation;
+using UnityEditor.TestTools.TestRunner.Api;
+
+namespace UnityEditor.TestTools.TestRunner.UnityTestProtocol
+{
+ internal class UtpMessageReporter : IUtpMessageReporter
+ {
+ public ITestRunnerApiMapper TestRunnerApiMapper;
+ public IUtpLogger Logger;
+
+ public UtpMessageReporter(IUtpLogger utpLogger)
+ {
+ TestRunnerApiMapper = new TestRunnerApiMapper();
+ Logger = utpLogger;
+ }
+
+ public void ReportAssemblyCompilationErrors(string assembly, IEnumerable<CompilerMessage> errorCompilerMessages)
+ {
+ var compilationErrorMessage = new AssemblyCompilationErrorsMessage
+ {
+ assembly = assembly,
+ errors = errorCompilerMessages.Select(x => x.message).ToArray()
+ };
+
+ Logger.Log(compilationErrorMessage);
+ }
+
+ public void ReportTestRunStarted(ITestAdaptor testsToRun)
+ {
+ var msg = TestRunnerApiMapper.MapTestToTestPlanMessage(testsToRun);
+
+ Logger.Log(msg);
+ }
+
+ public void ReportTestStarted(ITestAdaptor test)
+ {
+ if (test.IsSuite)
+ return;
+
+ var msg = TestRunnerApiMapper.MapTestToTestStartedMessage(test);
+
+ Logger.Log(msg);
+ }
+
+ public void ReportTestFinished(ITestResultAdaptor result)
+ {
+ if (result.Test.IsSuite)
+ return;
+
+ var msg = TestRunnerApiMapper.TestResultToTestFinishedMessage(result);
+
+ Logger.Log(msg);
+ }
+ }
+}