Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.