diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 753b961..0313bea 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -93,8 +93,8 @@ jobs: --editor-version "$UNITY_EDITOR_VERSION" \ --mode EditMode \ --output Logs/TestResults/editmode.xml \ - --timeout 900 \ - -- -force-glcore -logFile Logs/editmode.log + --timeout 1200 \ + -- -force-glcore -timestamps -logFile Logs/editmode.log DISPLAY_SESSION - name: Return Unity license diff --git a/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs b/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs new file mode 100644 index 0000000..124df82 --- /dev/null +++ b/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs @@ -0,0 +1,43 @@ +using System; +using NUnit.Framework.Interfaces; +using UnityEngine; +using UnityEngine.TestRunner; + +[assembly: TestRunCallback(typeof(MackySoft.SerializeReferenceExtensions.Tests.BatchTestProgress))] + +namespace MackySoft.SerializeReferenceExtensions.Tests +{ + // Results XML is written only after the run finishes. Keep the current test + // in the Editor log even when a native crash prevents that final report. + public sealed class BatchTestProgress : ITestRunCallback + { + public void RunStarted (ITest testsToRun) => Write("RUN START", testsToRun.FullName); + + public void RunFinished (ITestResult result) => Write("RUN FINISH", result.ResultState.ToString()); + + public void TestStarted (ITest test) + { + if (!test.IsSuite) + { + Write("START", test.FullName); + } + } + + public void TestFinished (ITestResult result) + { + if (!result.Test.IsSuite) + { + Write("FINISH", result.Test.FullName + " " + result.ResultState); + } + } + + private static void Write (string phase, string detail) + { + if (Application.isBatchMode) + { + Debug.LogFormat(LogType.Log, LogOption.NoStacktrace, null, + "[EditMode {0:O}] {1} {2}", DateTime.UtcNow, phase, detail); + } + } + } +} diff --git a/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs.meta b/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs.meta new file mode 100644 index 0000000..804b913 --- /dev/null +++ b/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cc093637968f48a3aeda9afdb4586ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: