Remove static weaver state

This commit is contained in:
Paul Pacheco 2020-09-22 12:33:48 -05:00
parent 116336fbf1
commit 3fec9ec880
2 changed files with 1 additions and 16 deletions

View File

@ -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);
}
}

View File

@ -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]