mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Remove static weaver state
This commit is contained in:
parent
116336fbf1
commit
3fec9ec880
@ -26,10 +26,6 @@ public static class CompilationFinishedHook
|
||||
// controls weather Weaver errors are reported direct to the Unity console (tests enable this)
|
||||
public static bool UnityLogEnabled = true;
|
||||
|
||||
// holds the result status of our latest Weave operation
|
||||
// NOTE: WeaveFailed is critical to unit tests, but isn't used for anything else.
|
||||
public static bool WeaveFailed { get; private set; }
|
||||
|
||||
// warning message handler that also calls OnWarningMethod delegate
|
||||
static void HandleWarning(string msg)
|
||||
{
|
||||
@ -147,17 +143,10 @@ static void OnCompilationFinished(string assemblyPath, CompilerMessage[] message
|
||||
Log.WarningMethod = HandleWarning;
|
||||
Log.ErrorMethod = HandleError;
|
||||
|
||||
if (Weaver.WeaveAssembly(assemblyPath, dependencyPaths.ToArray()))
|
||||
{
|
||||
// NOTE: WeaveFailed is critical for unit tests but isn't used elsewhere
|
||||
WeaveFailed = false;
|
||||
}
|
||||
else
|
||||
if (!Weaver.WeaveAssembly(assemblyPath, dependencyPaths.ToArray()))
|
||||
{
|
||||
// Set false...will be checked in \Editor\EnterPlayModeSettingsCheck.CheckSuccessfulWeave()
|
||||
SessionState.SetBool("MIRROR_WEAVE_SUCCESS", false);
|
||||
|
||||
WeaveFailed = true;
|
||||
if (UnityLogEnabled) Debug.LogError("Weaving failed for: " + assemblyPath);
|
||||
}
|
||||
}
|
||||
|
@ -74,10 +74,6 @@ protected void BuildAndWeaveTestAssembly(string className, string testName)
|
||||
// ensure all errors have a location
|
||||
Assert.That(error, Does.Match(@"\(at .*\)$"));
|
||||
}
|
||||
if (weaverErrors.Count > 0)
|
||||
Assert.That(CompilationFinishedHook.WeaveFailed, Is.True, "Weaver should fail if there are errors");
|
||||
else
|
||||
Assert.That(CompilationFinishedHook.WeaveFailed, Is.False, "Weaver should succeed if there are no errors");
|
||||
}
|
||||
|
||||
[OneTimeSetUp]
|
||||
|
Loading…
Reference in New Issue
Block a user