feat: integrate performance upgrade and agent inspection tooling
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEditor.TestTools.TestRunner.Api;
|
||||
using UnityEngine;
|
||||
[InitializeOnLoad]
|
||||
public static class PlayerAcceptance
|
||||
{
|
||||
private static readonly TestRunnerApi Api;
|
||||
static PlayerAcceptance() { Api = ScriptableObject.CreateInstance<TestRunnerApi>(); Api.RegisterCallbacks(new Results()); }
|
||||
public static string Run()
|
||||
{
|
||||
SessionState.SetBool("Shrink.PlayerAcceptance.Active", true);
|
||||
return Api.Execute(new ExecutionSettings(new Filter { testMode = TestMode.PlayMode, assemblyNames = new[] { "ShrinkSDK.AgentSupport.PlayerTests" }, targetPlatform = BuildTarget.StandaloneWindows64 }));
|
||||
}
|
||||
private sealed class Results : ICallbacks
|
||||
{
|
||||
public void RunStarted(ITestAdaptor tests) { }
|
||||
public void TestStarted(ITestAdaptor test) { }
|
||||
public void TestFinished(ITestResultAdaptor result) { }
|
||||
public void RunFinished(ITestResultAdaptor result)
|
||||
{
|
||||
if (!SessionState.GetBool("Shrink.PlayerAcceptance.Active", false)) return;
|
||||
SessionState.SetBool("Shrink.PlayerAcceptance.Active", false);
|
||||
Directory.CreateDirectory("Artifacts/AgentSupport");
|
||||
File.WriteAllText("Artifacts/AgentSupport/unity-player-results.xml", result.ToXml().OuterXml);
|
||||
Debug.Log("Shrink Player acceptance: " + result.PassCount + " passed, " + result.FailCount + " failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84cf42c70f18cd84b9cdca62969b6af8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "ShrinkSDK.AgentSupport.EditorTests",
|
||||
"references": [],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"optionalUnityReferences": [
|
||||
"TestAssemblies"
|
||||
],
|
||||
"autoReferenced": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7d77cac6e21f93479774330dd7bda65
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user