private IEnumerator timeoutCheck() { float pauseEndTime = Time.realtimeSinceStartup + timeout; while (Time.realtimeSinceStartup < pauseEndTime) { yield return(0); } if (LeanTest.testsFinished == false) { LeanTest.overview(); } }
private IEnumerator timeoutCheck() { var pauseEndTime = Time.realtimeSinceStartup + timeout; while (Time.realtimeSinceStartup < pauseEndTime) { yield return(0); } if (LeanTest.testsFinished == false) { Debug.Log(LeanTest.formatB("Tests timed out!")); LeanTest.overview(); } }
private IEnumerator timeoutCheck() { float pauseEndTime = Time.realtimeSinceStartup + timeout; while (Time.realtimeSinceStartup < pauseEndTime) { yield return(0); } if (!LeanTest.testsFinished) { UnityEngine.Debug.Log(LeanTest.formatB("Tests timed out!")); LeanTest.overview(); } }
private IEnumerator timeoutCheck() { LeanTester leanTester = null; float single = Time.realtimeSinceStartup + leanTester.timeout; while (Time.realtimeSinceStartup < single) { yield return(0); } if (!LeanTest.testsFinished) { UnityEngine.Debug.Log(LeanTest.formatB("Tests timed out!")); LeanTest.overview(); } }
public static void expect(bool didPass, string definition, string failExplaination = null) { float single = LeanTest.printOutLength(definition); int num = 40 - (int)(single * 1.05f); string str = "".PadRight(num, "_"[0]); string[] strArrays = new string[] { LeanTest.formatB(definition), " ", str, " [ ", null, null }; strArrays[4] = (didPass ? LeanTest.formatC("pass", "green") : LeanTest.formatC("fail", "red")); strArrays[5] = " ]"; string str1 = string.Concat(strArrays); if (!didPass && failExplaination != null) { str1 = string.Concat(str1, " - ", failExplaination); } Debug.Log(str1); if (didPass) { LeanTest.passes++; } LeanTest.tests++; if (LeanTest.tests == LeanTest.expected && !LeanTest.testsFinished) { LeanTest.overview(); } else if (LeanTest.tests > LeanTest.expected) { Debug.Log(string.Concat(LeanTest.formatB("Too many tests for a final report!"), " set LeanTest.expected = ", LeanTest.tests)); } if (!LeanTest.timeoutStarted) { LeanTest.timeoutStarted = true; GameObject gameObject = new GameObject() { name = "~LeanTest" }; (gameObject.AddComponent(typeof(LeanTester)) as LeanTester).timeout = LeanTest.timeout; gameObject.hideFlags = HideFlags.HideAndDontSave; } }