mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
use WeaverTests error handling functions
This commit is contained in:
parent
eb592eb0e1
commit
523a6c944d
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -92,7 +93,7 @@ public static void Clear()
|
|||||||
DeleteOutputOnClear = false;
|
DeleteOutputOnClear = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Build()
|
public static void Build(Action<string> OnWarning, Action<string> OnError)
|
||||||
{
|
{
|
||||||
AssemblyBuilder assemblyBuilder = new AssemblyBuilder(Path.Combine(OutputDirectory, OutputFile), SourceFiles.ToArray())
|
AssemblyBuilder assemblyBuilder = new AssemblyBuilder(Path.Combine(OutputDirectory, OutputFile), SourceFiles.ToArray())
|
||||||
{
|
{
|
||||||
@ -154,11 +155,11 @@ public static void Build()
|
|||||||
{
|
{
|
||||||
if (message.DiagnosticType == DiagnosticType.Warning)
|
if (message.DiagnosticType == DiagnosticType.Warning)
|
||||||
{
|
{
|
||||||
Debug.LogWarning(message.MessageData);
|
OnWarning(message.MessageData);
|
||||||
}
|
}
|
||||||
else if (message.DiagnosticType == DiagnosticType.Error)
|
else if (message.DiagnosticType == DiagnosticType.Error)
|
||||||
{
|
{
|
||||||
Debug.LogError(message.MessageData);
|
OnError(message.MessageData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO need to feed them to weaverWarnings/weaverErrors
|
// TODO need to feed them to weaverWarnings/weaverErrors
|
||||||
|
@ -32,7 +32,7 @@ protected void BuildAndWeaveTestAssembly(string className, string testName)
|
|||||||
string testSourceDirectory = className + "~";
|
string testSourceDirectory = className + "~";
|
||||||
WeaverAssembler.OutputFile = Path.Combine(testSourceDirectory, testName + ".dll");
|
WeaverAssembler.OutputFile = Path.Combine(testSourceDirectory, testName + ".dll");
|
||||||
WeaverAssembler.AddSourceFiles(new string[] { Path.Combine(testSourceDirectory, testName + ".cs") });
|
WeaverAssembler.AddSourceFiles(new string[] { Path.Combine(testSourceDirectory, testName + ".cs") });
|
||||||
WeaverAssembler.Build();
|
WeaverAssembler.Build(HandleWeaverWarning, HandleWeaverError);
|
||||||
|
|
||||||
Assert.That(WeaverAssembler.CompilerErrors, Is.False);
|
Assert.That(WeaverAssembler.CompilerErrors, Is.False);
|
||||||
foreach (string error in weaverErrors)
|
foreach (string error in weaverErrors)
|
||||||
|
Loading…
Reference in New Issue
Block a user